Search Results

Search found 20971 results on 839 pages for 'options menu'.

Page 12/839 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • PHP Menu Items Count then add under more button

    - by Adrian M.
    Hello, I use the bellow code to load the main menu elements from some CMS, the present code is perfect except that it loads ALL the main items on a single line of menu - which will make the width of it unusable in any centered design (under 1000px).. I want to change this script so after 15 main elements will add a "MORE" button under which the rest of the main menu items will show as sub-items of this "MORE" button (they will not have their own sub-items as the first 15 do).. How can I do it? Thanks! <?php require_once( '../../../inc/header.inc.php' ); require_once( DIRECTORY_PATH_INC . 'membership_levels.inc.php' ); require_once( DIRECTORY_PATH_ROOT . "templates/tmpl_{$tmpl}/scripts/TemplMenu.php" ); class SimpleMenu extends TemplMenu { function getCode() { $this->iElementsCntInLine = 100; $this->getMenuInfo(); $this->genTopItems(); return $this->sCode; } function genTopItem($sText, $sLink, $sTarget, $sOnclick, $bActive, $iItemID, $isBold = false, $sPicture = '') { $sActiveStyle = ($bActive) ? ' id="tm_active"' : ''; if (!$bActive) { $sAlt= $sOnclick ? ( ' alt="' . $sOnclick . '"' ) : ''; $sTarget = $sTarget ? ( ' target="_parent"' ) : ''; } $sLink = (strpos($sLink, 'http://') === false && !strlen($sOnclick)) ? $this->sSiteUrl . $sLink : $sLink; $sSubMenu = $this->getAllSubMenus($iItemID); $sImgTabStyle = $sPictureRep = ''; if ($isBold && $sPicture != '') { $sPicturePath = getTemplateIcon($sPicture); $sPictureRep = "<img src='{$sPicturePath}' style='vertical-align:middle;width:16px;height:16px;' />"; $sText = '&nbsp;'; $sImgTabStyle = 'style="width:38px;"'; } $sMainSubs = ($sSubMenu=='') ? '' : " {$sSubMenu} </a>"; $this->sCode .= " <li><a href='{$sLink}' {$sOnclick} target='_parent'>{$sPictureRep}{$sText}</a> <div id='submenu'> <ul> <li>{$sMainSubs}</li> </ul> </div> </li> "; } } $objMenu = new SimpleMenu(); echo "<ul id='ddmenu'>"; echo $objMenu->getCode(); echo "</ul>"; ?>

    Read the article

  • How can I get a fixed-position menu like slashdot's comment filtration menu

    - by pkaeding
    Slashdot has a little widget that allows you to tweak your comment threshold to filter out down-modded comments. It will be in one place if you scroll to the top of the page, and as you scroll down, at some point, where its original home is about to scroll off the page, it will switch to fixed position, and stay on your screen. (To see an example, click here.) My question is, how can I accomplish the same effect of having a menu be in one place when scrolled up, and switch to fixed position as the user scrolls down? I know this will involve a combination of CSS and javascript. I'm not necessarily looking for a full example of working code, but what steps will my code need to go through?

    Read the article

  • trying to center a css menu made on purecssmenu.com

    - by Party Mcfly
    i have a menu that i generated on purecssmenu.com and im having trouble trying to center it on my page here is the code... <!-- Start PureCSSMenu.com STYLE --> <style> #pcm{display:none;} ul.pureCssMenu ul{display:none} ul.pureCssMenu li:hover>ul{display:block} ul.pureCssMenu ul{position: absolute;left:-1px;top:98%;} ul.pureCssMenu ul ul{position: absolute;left:98%;top:-2px;} ul.pureCssMenu,ul.pureCssMenu ul { margin:0px; list-style:none; padding:0px 2px 2px 0px; background-color:#000000; background-repeat:repeat; border-color:#000000; border-width:1px; border-style:solid; } ul.pureCssMenu table {border-collapse:collapse}ul.pureCssMenu { display:block; zoom:1; float: left; } ul.pureCssMenu ul{ width:80.85000000000001px; } ul.pureCssMenu li{ display:block; margin:2px 0px 0px 2px; font-size:0px; } ul.pureCssMenu a:active, ul.pureCssMenu a:focus { outline-style:none; } ul.pureCssMenu a, ul.pureCssMenu li.dis a:hover, ul.pureCssMenu li.sep a:hover { display:block; vertical-align:middle; background-color:#000000; border-width:1px; border-color:#000000; border-style:solid; text-align:left; text-decoration:none; padding:2px 5px 2px 10px; _padding-left:0; font:11px Arial; color: #969696; text-decoration:none; cursor:default; } ul.pureCssMenu span{ overflow:hidden; } ul.pureCssMenu li { float:left; } ul.pureCssMenu ul li { float:none; } ul.pureCssMenu ul a { text-align:left; white-space:nowrap; } ul.pureCssMenu li.sep{ text-align:left; padding:0px; line-height:0; height:100%; } ul.pureCssMenu li.sep span{ float:none; padding-right:0; width:3px; height:100%; display:inline-block; background-color:#cccccc #111111 #111111 #cccccc; background-image:none;} ul.pureCssMenu ul li.sep span{ width:100%; height:3px; } ul.pureCssMenu li:hover{ position:relative; } ul.pureCssMenu li:hover>a{ background-color:#000000; border-color:#000000; border-style:solid; font:11px Arial; color: #ffa500; text-decoration:none; } ul.pureCssMenu li a:hover{ position:relative; background-color:#000000; border-color:#000000; border-style:solid; font:11px Arial; color: #ffa500; text-decoration:none; } ul.pureCssMenu li.dis a { color: #666 !important; } ul.pureCssMenu img {border: none;float:left;_float:none;margin-right:2px;width:16px; height:16px; } ul.pureCssMenu ul img {width:16px; height:16px; } ul.pureCssMenu img.over{display:none} ul.pureCssMenu li.dis a:hover img.over{display:none !important} ul.pureCssMenu li.dis a:hover img.def {display:inline !important} ul.pureCssMenu li:hover > a img.def {display:none} ul.pureCssMenu li:hover > a img.over {display:inline} ul.pureCssMenu a:hover img.over,ul.pureCssMenu a:hover ul img.def,ul.pureCssMenu a:hover a:hover img.over{display:inline} ul.pureCssMenu a:hover img.def,ul.pureCssMenu a:hover ul img.over,ul.pureCssMenu a:hover a:hover img.def{display:none} ul.pureCssMenu a:hover ul{display:block} ul.pureCssMenu span{ display:block; background-image:url(./images/arr_white.gif); background-position:right center; background-repeat: no-repeat; padding-right:12px;} ul.pureCssMenu li:hover>a>span{ background-image:url(./images/arrv_white.gif); } ul.pureCssMenu a:hover span{ _background-image:url(./images/arrv_white.gif)} ul.pureCssMenu ul span,ul.pureCssMenu a:hover table span{background-image:url(./images/arr_white.gif)} </style> <!-- End PureCSSMenu.com STYLE --> and here is the html, witch is probably not even needed in this posted but i figure i would include it.. i just want that menu centered inside my website. <!-- Start PureCSSMenu.com MENU --> <ul class="pureCssMenu pureCssMenum"> <li class="pureCssMenui"><a class="pureCssMenui" href="home.html" target="scare">home</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">about</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>haunts</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]--> <ul class="pureCssMenum"> <li class="pureCssMenui"><a class="pureCssMenui" href="#">2009</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">2010</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">2011</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">2012</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">studio</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>products</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]--> <ul class="pureCssMenum"> <li class="pureCssMenui"><a class="pureCssMenui" href="#">nightmares</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">hauntworks</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">atmosfears</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">frightwears</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#"><span>links</span><![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]--> <ul class="pureCssMenum"> <li class="pureCssMenui"><a class="pureCssMenui" href="#">haunts</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">suppliers</a></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">resources</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--></li> <li class="pureCssMenui"><a class="pureCssMenui" href="#">contact</a></li> </ul> <a id="pcm" href="http://www.purecssmenu.com/">CSS Drop Down Menu by PureCSSMenu.com</a> <!-- End PureCSSMenu.com MENU --> thanks in advance for your time.

    Read the article

  • Python Game using pyGame with Window Menu elements

    - by Zoja
    Here's the deal. I'm trying to write an arkanoid clone game and the thing is that I need a window menu like you get in pyGTK. For example File-(Open/Save/Exit) .. something like that and opening an "about" context where the author should be written. I'm already using pyGame for writting the game logic. I've tried pgu to write the GUI but that doesn't help me, altough it has those menu elements I'm taking about, you can't include the screen of the game in it's container. Does anybody know how to include such window menus with the usage of pyGame ?

    Read the article

  • how to add menu dynamically in Qt

    - by Solitaire
    Hi, I want to add, submenu to a menu item dynamically. How can I achive this? I tried like this, I have created an Action and submenu. Then I have added the submenu to action. But, I have connected the “triggered” signal of action. its getting crash if I click on the action.. I have also handled the “aboutToShow” signal of menu, same its also getting crash when I click on action.. Here is the sampe code. Submenu = new QMenu(this); connect(Submenu, SIGNAL( aboutToShow()), this, SLOT(move ())); QAction *test = new QAction(tr("Selection"), this); test ->setMenu(Submenu); menubar()->addAction(test); I want to get the notification, before the display of submenu..

    Read the article

  • Creating a menu to switch languages on site

    - by user342391
    I have a dropdown menu on my site that I want to use to switch between the different languages: <select onChange="if(this.selectedIndex!=0) self.location=this.options[this.selectedIndex].value" name="userLanguage" id="userLanguage"> <option value="http://demo.com/?lang=en"> English (International)</option> <option value="http://demo.com/?lang=es"> Español (European)</option> </select> How can I get the above menu to display which language is currently showing. Is there someway of showing an active state. Site is using php. Thanks in advance.

    Read the article

  • I'm looking for Sidebar Menu Library for iOS

    - by Swordfish
    I'm looking for sidebar menu library similar to facebook. But sliding direction is opposite, not sliding left and right. What I need is up/down sliding way. I found many great soltutions for sidebar menu. But these things are usually that sliding directions is not what I need. These way is similar to taskbar of 6.0 ios Version. My app is for iPad, So, I want to use the bottom side of the screen. Weather + use this way. If anyone knows the solution to solve this, Please let me know it.

    Read the article

  • Android: how do i custom arrange menu items?

    - by mtmurdock
    I would like to arrange the menu items in my app so that one item appears in its own line, and the other 3 items appear below it. I know that this is possible because i have seen apps do it. I tried writing a menu xml with linear layouts to arrange the items, but this doesnt work. I have also tried putting them in different groups, but I had no luck with that either. I know that this is possible: i have seen it done. Anyone have any ideas?

    Read the article

  • Change form field options dynamically (and restore previously selected options) using jQuery

    - by Martin
    I'm fairly new to both jQuery and JavaScript so can anyone please point out what I'm missing here? I have a form with multiple pairs of select fields, where the content of the second field relies on the selection of the first one. Once a value is chosen from the first one then a piece of jQuery code empties the corresponding second select options, gets new values as JSON and inserts them as new select values. All of this works with the code I've written. However if a user has chosen a second value, I'd like to restore it if possible (meaning if the new values also include the one previously selected). I tried to do this by first saving the second value and then trying to set it once the new options have been inserted. This did not work. However when trying to debug I inserted an alert() just before restoring the second value and with that in there it does work... Am I missing something very basic here? Any help would be appreciated. HTML: <select name="party-0-first" id="id_party-0-first"> <option value="" selected="selected">---------</option> <option value="1">first_value1</option> <option value="2">first_value2</option> <option value="3">first_value3</option> <option value="4">first_value4</option> </select> <select name="party-0-second" id="id_party-0-second"> <option value="" selected="selected">---------</option> <option value="1">second_value1</option> <option value="2">second_value2</option> <option value="3">second_value3</option> <option value="4">second_value4</option> </select> <select name="party-1-first" id="id_party-1-first"> ... JavaScript: $.fn.setSecond = function() { var divName = $(this).attr("name"); divName = divName.replace('-first', ''); divName = divName.replace('party-', ''); // Save the currently selected value of the "second" select box // This seems to work properly setValue = $('#id_party-' + divName + '-second').val(); // Get the new values $.getJSON("/json_opsys/", { client: $(this).val() }, function(data){ $('#id_party-' + divName + '-second').empty(); $('#id_party-' + divName + '-second').append('<option value="" selected="selected">---------</option>'); $.each(data, function(i, item){ $('#id_party-' + divName + '-second').append('<option value="' + item.pk + '">' + item.fields.name + '</option>'); }); }); // Here I try to restore the selected value // This does not work normally, however if I place a javascript alert() before // this for some reason it does work $('#id_party-' + divName + '-second').val(setValue); $(document).ready(function(){ $('[id*=first]').change(function() { $(this).setSecond(); }); });

    Read the article

  • Magento table rates custom options

    - by Usman Ahmad
    in Tablerate.php I want to change the calculation. So for some Products with custom options like width, height the shipping cost must change. I tried with this method to find out if one product in cart has width or height greater than 60cm (example). But currently I have no Idea how to get custom option values... this code working well. foreach ($request->getAllItems() as $item) { echo 'Name: '.$item->getName(). '<br/> SKU:'.$item->getSku(). '<br/> ProductID: '.$item->getProductId(). '<br/> Price: '.$item->getPrice().'<br/>'; } Thanks

    Read the article

  • Add "My Dropbox" to Your Windows 7 Start Menu

    - by The Geek
    Over here at How-To Geek, we’re huge fans of Dropbox, the amazingly fast online file sync utility, but we’d be even happier if we could natively add it to the Windows 7 Start Menu, where it belongs. And today, that’s what we’ll do. Yep, that’s right. You can add it to the Start Menu… using a silly hack to the Libraries feature and renaming the Recorded TV library to a different name. It’s not a perfect solution, but you can access your Dropbox folder this way and it just seems to belong there. First things first, head into the Customize Start Menu panel by right-clicking on the start menu and using Properties, then make sure that Recorded TV is set to “Display as a link”. Next, right-click on Recorded TV, choose Rename, and then change it to something else like My Dropbox.   Now you’ll want to right-click on that button again, and choose Properties, where you’ll see the Library locations in the list… the general idea is that you want to remove Recorded TV, and then add your Dropbox folder. Oh, and you’ll probably want to make sure to set “Optimize this library for” to “General Items”. At this point, you can just click on My Dropbox, and you’ll see, well, Your Dropbox! (no surprise there). Yeah, I know, it’s totally a hack. But it’s a very useful one! Also, if you aren’t already using Dropbox, you should really check it out—2 GB for free, accessible via the web from anywhere, and you can sync to multiple desktops. Similar Articles Productive Geek Tips Use the Windows Key for the "Start" Menu in Ubuntu LinuxAccess Your Dropbox Files in Google ChromeSpeed up Windows Vista Start Menu Search By Limiting ResultsPin Any Folder to the Vista Start Menu the Easy WayEnable "Pin to Start Menu" for Folders in Windows Vista / XP TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Classic Cinema Online offers 100’s of OnDemand Movies OutSync will Sync Photos of your Friends on Facebook and Outlook Windows 7 Easter Theme YoWindoW, a real time weather screensaver Optimize your computer the Microsoft way Stormpulse provides slick, real time weather data

    Read the article

  • Indicator menu require long press to open

    - by thor
    I am using 11.10 on my laptop and have a following issue: If I single click on items in notification area (or indicators), like messaging menu, sound menu, calendar, a menu appears and disappears as soon as mouse button is released. I need to do a long press then move pointer to menu area to be able to select items in it. Any clues to fix it? P.S. This is a fresh install but my home folder (thus settings) were restored from previous Ubuntu installation.

    Read the article

  • Game/Application menu as a central part of the game/application

    - by Javalicious
    I am developing a Java application, well, it's actually a small game. I want to build up the application as follows: when it starts, a window should appear which has a menu with four choices: 'Start game', 'Options', 'Highscores' and 'Quit'. If you then click game, the game starts, preferrably in the same window, if you click options, well you know the drill. How should I program this? At the moment, I'm considering using a CardLayout, but I'm not sure this is the right way to do this. Do you guys maybe have another proposition?

    Read the article

  • CakePHP form $options['options']

    - by James
    Hey! Total CakePHP noob here. This is sort of a two fold question. In a view that is used for adding user objects I would like to use a drop down (selection) field in the form. Each user belongs to a group so when I add a user I want a drop down that contains all of the groups that the user could possibly join. Currently the group_id field is a textfield. I know how to force it to be a selection field, but I don't know how to populate the selection with the names of the groups programmatically. The Current method: echo $form->input('group_id', array( '1' => 'NameOfGroup1', '2' => 'NameOfGroup2', '3' => 'NameOfGroup3') ); I want to generate the options array programmatically though. echo $form->input('group_id', $this->Group->find('list')); This doesn't work though. I get an error: Undefined property: View::$Group [APP/views/users/add.ctp, line 8] To me this means that I don't have access to the Group object from inside my user view. How can I accomplish this? Again, I want to do it programmatically so that it updates as I add groups or remove them.

    Read the article

  • Javascript menu that hovers over initial element

    - by TenJack
    I'm trying to build a javascript menu using prototype that when you mouseover an element, that element is hidden and a bigger element is shown in its place that closes onmouseout. This is what I have so far to give you an idea, but it doesn't work and is buggy. I'm not sure what the best general approach is: EDIT: using the prototype refactor from remi bourgarel: function socialMenuInit(){ var social_menu = $('sociable_menu'); social_menu.hide(); var share_words = $('share_words'); Event.observe(share_words,"mouseover",function(){ share_words.hide(); social_menu.show(); }); Event.observe(social_menu,"mouseout",function(){ social_menu.hide(); share_words.show(); }); } EDIT: The main problem now is that the second bigger menu(social_menu) that is shown on top of the smaller mouseover triggering element(share_words) only closes when you mouseout the smaller trigger element even though this element is hidden. EDIT: This is the html and css I am using: <div id="share_words">share</div> <div id="sociable_menu"></div> #share_words{ display: none; border: 1px solid white; position: absolute; right: 320px; top:0px; padding: 4px; background-image: url('/images/icons/group.png'); background-repeat: no-repeat; background-position:7px 6px; text-indent:26px; color: white; z-index: 15; } #sociable_menu{ border: 1px solid black; padding: 5px; position: absolute; right: 275px; top: -10px; z-index: 20; } Thanks for any help.

    Read the article

  • Dynamic vertical menu for Wordpress

    - by buttonstack
    Does anyone know how to achieve a dynamic multi-level page menu for Wordpress? I have found a couple scripts but none of them put the subpages directly under the parent page or some will show every subpage to the entire menu Example: page1 (selected) –subpage1-1 –subpage1-2 page2 page3 This code comes close by inserting the subpages directly under, but it doesn't hide the subpages to the other pages. <?php if($post->post_parent) { $children = preg_replace('@\<li([^>^]*)>\<a([^>^]*)>(.*?)\<\/a>@i','<li$1><a$2><span>$3</span></a>',wp_list_pages('title_li=&amp;amp;amp;amp;amp;child_of='.$post->post_parent.'&amp;amp;amp;amp;amp;echo=0&amp;amp;amp;amp;amp;depth=1')); } else { $children = preg_replace('@\<li([^>^]*)>\<a([^>^]*)>(.*?)\<\/a>@i','<li$1><a$2><span>$3</span></a>',wp_list_pages('title_li=&amp;amp;amp;amp;amp;child_of='.$post->ID.'&amp;amp;amp;amp;amp;echo=0&amp;amp;amp;amp;amp;depth=1')); } if($children) { echo" <ul class=\"submenu\">\n". $children ."</ul>\n"; } ?>

    Read the article

  • Sharepoint page menu items gone?

    - by Richard
    I'm running MOSS 2007 and have created a new site under an existing one using sitemanager.aspx. I've done this on two machines. on one of those everything works correctly, while on the other some of the menu items for pages in the site seem to be gone. Also on the faulty site I get "Access denied" when I click "Version history". The permissions on both sites should be the same. I attach a screenshot of how the menus differ from each other. The one to the right (the faulty one) is unfortunately not in English but the items appearing on it are "Open link in a new window", "Copy", "Edit page settings" and "Version history". "View properties" and some more items are missing! What could have caused this? Screenshot: I'm running MOSS 2007 and have created a new site under an existing one using sitemanager.aspx. I've done this on two machines. on one of those everything works correctly, while on the other some of the menu items for pages in the site seem to be gone. Also on the faulty site I get "Access denied" when I click "Version history". The permissions on both sites should be the same. I attach a screenshot of how the menus differ from each other. The one to the right (the faulty one) is unfortunately not in English but the items appearing on it are "Open link in a new window", "Copy", "Edit page settings" and "Version history". "View properties" and some more items are missing! What could have caused this? Screenshot: hxxp://i40.tinypic.com/302naxx.jpg

    Read the article

  • Swing Menu dimensions

    - by ikurtz
    Greetings. I am trying to learn Java and Swing (today is my first day). I have been able to set up a menu in my test application. but the items occupy very little space (they are narrow). How do I go about extendng the amount of space it uses? I am studying Teach Yourself Java 6 in 21 Days 5th Ed, Java Swing, 2nd Edition, 2002 and Teach Yourself Programming With Java In 24 Hours, 4th Edition (2005) but none of them shed any light on this issue. EDIT: Menu code: JMenu _Game = new JMenu("Game"); JMenuItem _New = new JMenuItem("New"); JMenuItem _Exit = new JMenuItem("Exit"); JMenu _Turn = new JMenu("Turn"); JMenuItem _Red = new JMenuItem("Red"); JMenuItem _Yellow = new JMenuItem("Yellow"); _Turn.add(_Red); _Turn.add(_Yellow); _Game.add(_New); _Game.addSeparator(); _Game.add(_Turn); _Game.addSeparator(); _Game.add(_Exit); JMenu _Help = new JMenu("Help"); JMenuItem _About = new JMenuItem("About"); _Help.add(_About); JMenuBar _MenuBar = new JMenuBar(); _MenuBar.add(_Game); _MenuBar.add(_Help); setJMenuBar(_MenuBar); EDIT: Solved! JMenuItem _New = new JMenuItem("New "); just add spaces as needed! simple.

    Read the article

  • Router Alert options on IGMPv2 packets

    - by Scakko
    I'm trying to forge an IGMPv2 Membership Request packet and send it on a RAW socket. The RFC 3376 states: IGMP messages are encapsulated in IPv4 datagrams, with an IP protocol number of 2. Every IGMP message described in this document is sent with an IP Time-to-Live of 1, IP Precedence of Internetwork Control (e.g., Type of Service 0xc0), and carries an IP Router Alert option [RFC-2113] in its IP header So the IP_ROUTER_ALERT flag must be set. I'm trying to forge the strict necessary of the packet (e.g. only the IGMP header & payload), so i'm using the setsockopt to edit the IP options. some useful variables: #define C_IP_MULTICAST_TTL 1 #define C_IP_ROUTER_ALERT 1 int sockfd = 0; int ecsockopt = 0; int bytes_num = 0; int ip_multicast_ttl = C_IP_MULTICAST_TTL; int ip_router_alert = C_IP_ROUTER_ALERT; Here's how I open the RAW socket: sock_domain = AF_INET; sock_type = SOCK_RAW; sock_proto = IPPROTO_IGMP; if ((ecsockopt = socket(sock_domain,sock_type,sock_proto)) < 0) { printf("Error %d: Can't open socket.\n", errno); return 1; } else { printf("** Socket opened.\n"); } sockfd = ecsockopt; Then I set the TTL and Router Alert option: // Set the sent packets TTL if((ecsockopt = setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &ip_multicast_ttl, sizeof(ip_multicast_ttl))) < 0) { printf("Error %d: Can't set TTL.\n", ecsockopt); return 1; } else { printf("** TTL set.\n"); } // Set the Router Alert if((ecsockopt = setsockopt(sockfd, IPPROTO_IP, IP_ROUTER_ALERT, &ip_router_alert, sizeof(ip_router_alert))) < 0) { printf("Error %d: Can't set Router Alert.\n", ecsockopt); return 1; } else { printf("** Router Alert set.\n"); } The setsockopt of IP_ROUTER_ALERT returns 0. After forging the packet, i send it with sendto in this way: // Send the packet if((bytes_num = sendto(sockfd, packet, packet_size, 0, (struct sockaddr*) &mgroup1_addr, sizeof(mgroup1_addr))) < 0) { printf("Error %d: Can't send Membership report message.\n", bytes_num); return 1; } else { printf("** Membership report message sent. (bytes=%d)\n",bytes_num); } The packet is sent, but the IP_ROUTER_ALERT option (checked with wireshark) is missing. Am i doing something wrong? is there some other methods to set the IP_ROUTER_ALERT option? Thanks in advance.

    Read the article

  • How to add class to selective <li> in a generated menu

    - by Vikram
    Hi I am looking for a solution to add a class to every list item <li> which has a child item with a class of <span class="separator"> and a different class to <li> with an anchor link. I use Joomla and the menu is being generated somewhat like this: <ul class="menu"> <li class="item1"><a href="<!-- link goes here -->"><span>Home</span></a></li> <li class="parent item59"><span class="separator"><span>Demo</span></span></li> <li class="item62"><a href="<!-- link goes here -->"><span>Article</span></a></li> <li id="current" class="parent active item27"><a href="<!-- link goes here -->"><span>CMS</span></a> <ul> <li class="item50"><a href="<!-- link goes here -->"><span>The News</span></a></li> <li class="item48"><a href="<!-- link goes here -->"><span>Web Links</span></a></li> <li class="item65"><span class="separator"><span /></span></li> <li class="item49"><a href="<!-- link goes here -->"><span>News Feeds</span></a></li> <li class="item66"><span class="separator"><span /></span></li> <li class="item67"><span class="separator"><span /></span></li> <li class="item68"><span class="separator"><span /></span></li> </ul> </li> <li class="item71"><span class="separator"><span>Help</span></span></li> </ul> What I want is to add class "anclink" or "seplink" to the <li> depending on their child item so that the final output looks like below. <ul class="menu"> <li class="item1 anclink"><a href="<!-- link goes here -->"><span>Home</span></a></li> <li class="parent item59 seplink"><span class="separator"><span>Demo</span></span></li> <li class="item62 anclink"><a href="<!-- link goes here -->"><span>Article</span></a></li> <li id="current" class="parent active item27" anclink><a href="<!-- link goes here -->"><span>CMS</span></a> <ul> <li class="item50 anclink"><a href="<!-- link goes here -->"><span>The News</span></a></li> <li class="item48 anclink"><a href="<!-- link goes here -->"><span>Web Links</span></a></li> <li class="item65 seplink"><span class="separator"><span /></span></li> <li class="item49 anclink"><a href="<!-- link goes here -->"><span>News Feeds</span></a></li> <li class="item66 seplink"><span class="separator"><span /></span></li> <li class="item67 seplink"><span class="separator"><span /></span></li> <li class="item68 seplink"><span class="separator"><span /></span></li> </ul> </li> <li class="item71 seplink"><span class="separator"><span>Help</span></span></li> </ul> How can I achieve this using PHP or even a jQuery solution will be fine. Kindly help.

    Read the article

  • Blackberry Menu from native blackberry application

    - by chrishawn
    I have an application that inserts an ApplicationMenuItem into the native blackberry contacts menu. I can get this to work just fine. Now my question is how would I change or remove that ApplicationMenuItem based on the contact that i am highlighted on? Would I need to use a GlobalEventListener? I assume overriding makeMenu can only be done for menus on my own screens and not the native contacts screen?

    Read the article

  • CheckBox menu item Decrypt in JAVA GUI

    - by Nick
    I am working on a project and part of ask for: add a CheckBox menu item Decrypt which can be checked for decrypt or unchecked for Encrypt. This item should be tied to the toggle button in the GUI. Both should reflect the current status of encrypting/decrypting in the application which is I not sure how to begin with

    Read the article

  • jQuery multilevel crossbrowser dropdown menu

    - by Enrique
    Hi I've been testing lots of dropdown menus, but I was looking for some specific stuff: multilevel crossbrowser css based (mainly) if uses javascript, to be jQuery compatible easy to implement After discarding some menus, I arrived to Superfish http://users.tpg.com.au/j_birch/plugins/superfish/ I had to discard it too, because the z-index fix for IE didn't work for me So, does any1 know about one good multilevel dropdown crossbrowser menu? Thanks

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >