Search Results

Search found 3117 results on 125 pages for 'nan li'.

Page 16/125 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Jquery Livesearch with quicksilver plugin to include not just the <li>s

    - by 133794m3r
    Ok, what i'm trying to do here is to make the exact code found here here ordered list and make it so that it doesn't just not work when i try to add additional elements into the list. Also i'm planning on using the more effecient one linked to at the end but i cannot put it here so you'll have to find that link on your own sadly. Since i'm trying to use this for a knowledge base page i want to allow people to be able to search through the items on the page and go to the proper part(ie loading it into the viewing area) but it's not letting me even include a simple anchor in there. if there is anyway to do something similar or to edit it so that it'll include everything within the <li> that'd be great. I don't know if anyone out there has done something like this before, but if they have and wouldn't mind sharing the code with me i'd be extremely happy. If no one has but does know how to make it include everything within the <li> including text also a great thing to have. I imagine that i won't be the only person out there in this world with my exact query.

    Read the article

  • Preserving order when copying elements using Deliverance / XPath

    - by Jon Hadley
    How would I, using Deliverance & XPath (or CSS) selectors, select and copy list items .one and .three from each list below, but display them in the order of their parent list? <ul id="a-wrapper"> <li class="one"></li> <li class="two"></li> <li class="three"></li> <li class="four"></li> </li> <ul id="b-wrapper"> <li class="one"></li> <li class="two"></li> <li class="three"></li> <li class="four"></li> </ul> c,d,e,f,g etc.... The catch is it needs to use a href rule, eg: <prepend href="/blah/deblah" content="#x" theme="#y" /> Using the following just lists all the .one elements, then all the .three elements. <prepend href="/blah/deblah" content=".one" theme="#y" /> <prepend href="/blah/deblah" content=".three" theme="#y" />

    Read the article

  • How can I recurse up a DOM tree?

    - by smartdirt
    So I have a series of nested ul elements as part of a tree like below: <ul> <li> <ul> <li>1.1</li> <li>1.2</li> </ul> <ul> <li>2.1</li> <li> <ul> <li>2.2</li> </ul> </li> </ul> <ul> <li>3.1</li> <li>3.2</li> </ul> </li> </ul> Let's say when 3.1 is the selected node and when the user clicks previous the selected node should then be 2.2. The bad news is that there could be any number of levels deep. How can I find the previous node (li) in relationship to the currently selected node using jquery?

    Read the article

  • jquery next siblings

    - by Contra
    Hi stackoverflow! (first post!) Ive been trying to get this problem solved, but I cant seem to figure it out without some serious workarounds. if I have the following html code: <ul> <li class="parent"> headertext </li> <li> text </li> <li> text </li> <li> text </li> <li class="parent"> headertext </li> <li> text </li> <li> text </li> </ul> Now, how do I now just select the li's following the first parent (or second, for that matter)? Basically selecting an li with class=parent and the following siblings until it reaches another li with the parent class. I could restructure the list with nested lists, but I dont want to do that. Any suggestions?

    Read the article

  • Click event for dynamically added li element?

    - by user1774460
    I am having totally 20 links.First 10 links directly visible to user and remaining 10 links shown when user hover the down arrow image(used for hover). When user click any one hover link, the link till the currently clicked are moved to left side(another down arrow used for add the right side links to left side dynamically by creating li). This one working fine.But this is not working as vice versa. (i.e)When i click left side link it should navigate to right side.Click event not working for li element that i created dynamically. Please Can any one help for me?????? My sample Code: //To append the line from right hover to looplink div $('#loop_link').append(''+$('#pagelinkli_'+val3).html()+''); //To hide the link in right hover div once it selected and appended in loop link div $('#pagelink_a #pagelinkli_'+val3).css('display','none'); //This line to move the link from loop link to left hover div $('#pagelink_a_left ul').prepend((''+$('#pagelinkli_'+val6).html()+'')); //This line to hide the link in looplink div $('#loop_link #pagelinkli_'+val6).css('display','none'); This code is like navigating link from right hover to tab and from tab to left hover and vice versa.....

    Read the article

  • How to interpret situations where Math.Acos() reports invalid input?

    - by Sean Ochoa
    Hey all. I'm computing the angle between two vectors, and sometimes Math.Acos() returns NaN when it's input is out of bounds (-1 input && input 1) for a cosine. What does that mean, exactly? Would someone be able to explain what's happening? Any help is appreciated! Here's me method: public double AngleBetween(vector b) { var dotProd = this.Dot(b); var lenProd = this.Len*b.Len; var divOperation = dotProd/lenProd; // http://msdn.microsoft.com/en-us/library/system.math.acos.aspx return Math.Acos(divOperation) * (180.0 / Math.PI); }

    Read the article

  • JQuery tab Selection problem?

    - by PeAk
    New to JQuery and I was wondering how do I keep any tabbed selected when a user reloads the web page? What part of my code do I need to change? Here is my JQuery code. $(document).ready(function() { //When page loads... $(".form-content").hide(); //Hide all content var firstMenu = $("#home-menu ul li:first"); firstMenu.show(); firstMenu.find("a").addClass("selected-link"); //Activate first tab $(".form-content:first").show(); //Show first tab content //On Click Event $("#home-menu ul li").click(function() { $("#home-menu ul li a").removeClass("selected-link"); //Remove any "selected-link" class $(this).find("a").addClass("selected-link"); //Add "selected-link" class to selected tab $(".form-content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the selected-link tab + content $(activeTab).fadeIn(); //Fade in the selected-link ID content return false; }); }); Here is the XHTML code. <div id="home-menu"> <ul> <li><a href="#personal-info-form" title="Personal Info Form Link">Personal Info</a></li> <li><a href="#contact-info-form" title="Contact Info Form Link">Contact Info</a></li> </ul> </div> <div> <div id="personal-info-form" class="form-content"> <h2>Personal Information</h2> <form method="post" action="index.php"> <fieldset> <ul> <li><label for="first_name">First Name: </label><input type="text" name="first_name" id="first_name" size="25" class="input-size" value="<?php if(!empty($first_name)){ echo $first_name; } ?>" /></li> <li><label for="middle_name">Middle Name: </label><input type="text" name="middle_name" id="middle_name" size="25" class="input-size" value="<?php if(!empty($middle_name)){ echo $middle_name; } ?>" /></li> <li><label for="last_name">Last Name: </label><input type="text" name="last_name" id="last_name" size="25" class="input-size" value="<?php if(!empty($last_name)){ echo $last_name; } ?>" /></li> <li><label for="password-1">Password: </label><input type="password" name="password1" id="password-1" size="25" class="input-size" /></li> <li><label for="password-2">Confirm Password: </label><input type="password" name="password2" id="password-2" size="25" class="input-size" /></li> <li><input type="submit" name="submit" value="Save Changes" class="save-button" /> <input type="submit" name="submit" value="Preview Changes" class="preview-changes-button" /></li> </ul> </fieldset> </form> </div> <div id="contact-info-form" class="form-content"> <h2>Contact Information</h2> <form method="post" action="index.php" id="contact-form"> <fieldset> <ul> <li><label for="address">Address 1: </label><input type="text" name="address" id="address" size="25" class="input-size" value="<?php if (isset($_POST['address'])) { echo $_POST['address']; } else if(!empty($address)) { echo $address; } ?>" /></li> <li><label for="address_two">Address 2: </label><input type="text" name="address_two" id="address_two" size="25" class="input-size" value="<?php if (isset($_POST['address_two'])) { echo $_POST['address_two']; } else if(!empty($address_two)) { echo $address_two; } ?>" /></li> <li><label for="city_town">City/Town: </label><input type="text" name="city_town" id="city_town" size="25" class="input-size" value="<?php if (isset($_POST['city_town'])) { echo $_POST['city_town']; } else if(!empty($city_town)) { echo $city_town; } ?>" /></li> <li><input type="submit" name="submit" value="Save Changes" class="save-button" /> <input type="hidden" name="contact_info_submitted" value="true" /> <input type="submit" name="submit" value="Preview Changes" class="preview-changes-button" /></li> </ul> </fieldset> </form> </div> </div>

    Read the article

  • PHP HTML CSS Beginner USE CASE / SWITCH / IF ELSE? Need advice...

    - by WANNABE
    Building a website using a PHP based Ecommerce product Magnto. The problem I have is that I want to use tabbed navigation. My idea was to use CSS to show the TAB over the relevant Navigation menu item based on the URL. However, one URL always changes, so I wanted to somehow use an ifelse statement. I've come up with two methods that I think could work, could any experts tell me what they would think is best and how they would implement it? <div id="nav"> <ul id="mainnav"> <li><a href="index.php" title="Welcome page" <?php if ($page == 'index.php') { ?>class="active"<?php } ?>>Welcome</a></li> <li><a href="about_us.php" title="About us page" <?php if ($page == 'about_us.php') { ?>class="active"<?php } ?>>About us</a></li> <li><a href="services.php" title="Services page" <?php if ($page == 'services.php') { ?>class="active"<?php } ?>>Services</a></li> <li><a href="testimonials.php" title="Testimonials page" <?php if ($page == 'testimonials.php') { ?>class="active"<?php } ?>>Testimonials</a></li> <li><a href="contact_us.php" title="Contact us page" <?php if ($page == 'contact_us.php') { ?>class="active"<?php } ?>>Contact us</a></li> else <li><a href="store.php" title="Store Page" <?php ($page == 'store.php') { ?>class="active"<?php } ?>>Store</a></li> </ul> </div> $URL = store.php; SWITCH ($sample) { CASE home.php: <li><a href="index.php" title="Welcome page" <?php if ($page == 'index.php') { ?>class="active"<?php } ?>>Welcome</a></li> break; CASE services.php: <li><a href="services.php" title="Services page" <?php if ($page == 'services.php') { ?>class="active"<?php } ?>>Services</a></li> break; CASE aboutus.php: <li><a href="about_us.php" title="About us page" <?php if ($page == 'about_us.php') { ?>class="active"<?php } ?>>About us</a></li> break; DEFAULT: <li><a href="store.php" title="Store Page" <?php ($page == 'store.php') { ?>class="active"<?php } ?>>Store</a></li> } Thanks in advance

    Read the article

  • not able to remove nested lists in a jQuery variable

    - by Pradyut Bhattacharya
    Hi I have a nested oredered list which i m animating using this code... var $li = $("ol#update li"); function animate_li(){ $li.filter(':first') .animate({ height: 'show', opacity: 'show' }, 500, function(){ animate_li(); }); $li = $li.not(':first'); } animate_li(); now i want not to show or animate the nested lists(ol s) or the li s in the ols take a look at the example here The structure of my ols are <ol> <li class="bar248"> <div class="nli"> <div class="pic"> <img src="dir/anonymous-thumb.png"alt="image" /> </div> <div align="left" class="text"> <span> <span class="delete_button"><a href="#" id="test" class="delete_update">R</a></span> test shouted <span class="timestamp"> 2010/02/24 18:34:26 </span> <br /> this </span> </div> <div class="clear"></div> </div> <div class="padd"> </div> <ol class="comment"> <li> <div>Testing </div> </li> <li> <div>Another Test </div> </li> </ol> </li> </ol> I m able to hide the nested ols using this code... $("ol#update li ol").hide(); But still time is being consumed in animating them although they are hidden I m not able to remove the nested li s using this code var $li = $("ol#update li").not("ol#update li ol"); $li = $li.not("ol#update li ol"); Take a look at this here Any help thanks < br Pradyut

    Read the article

  • Superfish: How to keep sub menu open after it has been clicked

    - by Roland
    I'm having the following scenario. I have a menu and if one hovers over the menu a sub menu appears and if mouse moves out the sub menu disappears, now I want the following if I click on the on a item in the sub menu, I want the sub-menu to remain open, when the new page has been loaded. I'm using superfish Jquery plugin for this. Is this possible and if how. my code in html <div id="nav"> <div id="nav2"> <ul class="sf-menu sf-navbar "> <li> <a title="HOME" class="sf-with-ul " href="/index.php?r=site/index&amp;sid=1">HOME</a> </li> </ul> <ul class="sf-menu sf-navbar"> <li> <a href="?sid=2" id="gallery" class="sf-with-ul selected_main">GALLERY</a> <ul class="subs" id="sub1"><li class="arrow"><img src="images/arrow.gif" /></li><li><a title="Kitchens" href="/index.php?r=images/sddsd&amp;id=1">Kitchens</a></li><li><a title="Vanities" href="/index.php?r=images/sddsd&amp;id=2">Vanities</a></li></ul> </li> </ul> <ul class="sf-menu sf-navbar "> <li> <a href="?sid=3" class="sf-with-ul " >ACCESSORIES</a> <ul class="subs" id=""><li class="arrow"><img src="images/arrow.gif" /></li><li><a title="Door Handles" href="/index.php?r=images/sddsd&amp;id=2">Door Handles</a></li><li><a title="Spanners" href="/index.php?r=images/sddsd&amp;id=1">Spanners</a></li></ul> </li> </ul> <ul class="sf-menu sf-navbar "> <li> <a title="CONTACT US" class="sf-with-ul " href="/index.php?r=site/contact&amp;sid=4">CONTACT US</a> </li> </ul> </div> </div> and then the superfish code $(function(){ $("ul.sf-menu").superfish({ delay: 0, speed: 'fast', autoArrows: false, dropShadows: false }); }); I've also noticed that the following css code is used to display the item left: 0; top: 2.5em; z-index: 99;

    Read the article

  • Can I Number a GroupTemplate or ItemTemplate?

    - by Atomiton
    I would like to use a GroupTemplate to separate a list of items into groups. However, I need each Group to be numbered sequentially so I can link to them and implement some JS paging. I'm binding to an IEnumerable Here's some pseudo code. I would like the output to look like this: <a href="#group1">Go to Group 1<a> <a href="#group2">Go to Group 2<a> <a href="#group3">Go to Group 3<a> <ul id="group1"> <li>Item</li> <li>Item</li> <li>Item</li> </ul> <ul id="group2"> <li>Item</li> <li>Item</li> <li>Item</li> </ul> <ul id="group3"> <li>Item</li> <li>Item</li> <li>Item</li> </ul> Is this easy to do in a ListView, using GroupTemplate and ItemTemplate? <asp:ListView ID="lv" runat="server" GroupPlaceholderID="groupPlaceholder"> <LayoutTemplate> <asp:PlaceHolder ID="groupPlaceholder" runat="server"></asp:PlaceHolder> </LayoutTemplate> <GroupTemplate> <ul id="<!-- group-n goes here -->"> <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder> </ul> </GroupTemplate> <ItemTemplate> <li>Item</li> </ItemTemplate> </asp:ListView> I can get the number of groups to do the links at the top from the Datasource and basic math, but how do I get id="groupN" number into the template?

    Read the article

  • extra vertical space within <li> in IE7

    - by powerboy
    The test case is in below. Or you can view it in jsbin: http://jsbin.com/uxagi. <!DOCTYPE html> <html> <head> <style type="text/css"> body {margin: 20px; } #main {border: 1px solid red;} img {float: left; height: 100px; padding: 0 10px 10px 0;} ul {margin: 0; padding: 0; list-style-type: none;} </style> </head> <body> <div id="main"> <ul> <li> <img src="http://upload.wikimedia.org/wikipedia/en/thumb/0/07/CranebyLinson1894.jpg/100px-CranebyLinson1894.jpg" /> <div class="content">"The Open Boat" is a short story by American author Stephen Crane. First published in 1897, it was based on Crane's experience of having survived a shipwreck off the coast of Florida earlier that year while traveling to Cuba to work as a newspaper correspondent. Crane was stranded at sea for thirty hours when his ship, the SS Commodore, sank after hitting a sandbar. He and three other men were forced to navigate their way to shore in a small boat; one of the men, an oiler named Billie Higgins, drowned. Crane subsequently adapted his report into narrative form, and the short story "The Open Boat" was published in Scribner's Magazine. The story is told from the point of view of an anonymous correspondent, Crane's fictional doppelgänger, and the action closely resembles the author's experiences after the shipwreck. A volume titled The Open Boat and Other Tales of Adventure was published in the United States in 1898. Praised for its innovation by contemporary critics, the story is considered an exemplary work of literary Naturalism. One of the most frequently discussed works in Crane's canon, it is notable for its use of imagery, irony, symbolism, and exploration of themes including survival, solidarity, and the conflict between man and nature. H. G. Wells considered "The Open Boat" to be "beyond all question, the crown of all [Crane's] work".</div> </li> </ul> </div> </body> </html> Note that in standards-compliant browsers and IE8, there is no vertical space between the red border and the text. But there is vertical space in IE7 (haven't tested in IE6).

    Read the article

  • Activate Lightbox by clicking on LI rather than thumbnail

    - by NightMICU
    Hi everyone, Using Lightbox for a photo gallery and would like to initiate the function by clicking on the thumbnail's parent <li>rather than the thumbnail image. I have been able to do this easily with the thumbnail for the album (not using Lightbox, simply opening another page) with the following code: $(".item").click(function(){ window.location=$(this).find("a").attr("href");return false; }); However, can't seem to initiate Lightbox in a similar fashion. Ideas? Thanks!

    Read the article

  • Calling data from different model in Rails

    - by Danny McClelland
    Hi Everyone, I need to be able to call data from a different model - not just one field, but any of them. At the moment I have the following models: kase person company party I can call information from the company to the kase and from the person to the kase using this: <li>Client Company Address: <span class="address"><%=h @kase.company.companyaddress %></span></li> <li>Case Handler: <span><%=h @kase.person.personname %></span></li> Those two work, however if I add the following: <li>Client Company Fax: <span><%=h @kase.company.companyfax %></span></li> <li>Case Handler Tel: <span><%=h @kase.person.personmobile %></span></li> <li>Case Handler Email: <span><%=h @kase.person.personemail %></span></li> Any idea whats wrong? Thanks, Danny EDIT: I get the following error message: NoMethodError in Kases#show Showing app/views/kases/show.html.erb where line #37 raised: You have a nil object when you didn't expect it! The error occurred while evaluating nil.personname The lines that are noted are as follows: 34: <div id="clientinfo_showhide" style="display:none"> 35: <li>Client Company Address: <span class="address"><%=h @kase.company.companyaddress %></span></li> 36: <li>Client Company Fax: <span><%=h @kase.company.companyfax %></span></li> 37: <li>Case Handler: <span><%=h @kase.person.personname %></span></li> 38: <li>Case Handler Tel: <span><%=h @kase.person.personmobile %></span></li> 39: <li>Case Handler Email: <span><%=h @kase.person.personemail %></span></li> 40: </div> The model for the kase is as follows: class Kase belongs_to :company # foreign key: company_id belongs_to :person # foreign key in join table The model for the person is as follows: class Person has_many :kases # foreign key in join table belongs_to :company The model for the company is as follows: class Company has_many :kases has_many :people def to_s; companyname; end Hope this helps!

    Read the article

  • jQuery: modify href attribute for first level list only

    - by bloggerious
    I'm a noob in jQuery and have stuck at this. I have the following HTML code output from a PHP page: <ul class="cats"> <li><span><a href="cant_post_link_yet1">Lifestyle</a></span></li> <li><span><a href="cant_post_link_yet2">Entertainment</a></span></li> <li class="has_child"> <span><a href="cant_post_link_yet3">Technology</a></span> <ul class="subcats"> <li><span><a href="cant_post_link_yet4">Gadgets</a></span></li> <li><span><a href="cant_post_link_yet5">Hardware</a></span></li> </ul> </li> <li><span><a href="cant_post_link_yetsports">Sports</a></span></li> <li class="has_child"> <span><a href="cant_post_link_yet6">Design</a></span> <ul class="subcats"> <li class="has_child"> <span><a href="cant_post_link_yet7">Web Design</a></span> <ul class="subcat"> <li><span><a href="cant_post_link_yet8">Adobe Photoshop</a></span></li> </ul> </li> <li><span><a href="cant_post_link_yet9">Graphics and Print</a></span></li> </ul> </li> What's the correct jQuery code so that I can modify the href attribute for the first-level list only? Basically, I want to change the href of Technology and Design to be "#" but will not change the href of Web Design which is already on second-level list. More Info: In the code above, if list has subcategories, then it has the class has_child, whether it's on first-level or not. So I want only the first-level list which has class has_child to be modified the href to "#" I can't alter output anymore because it's in the PHP code. Any help is greatly appreciated.

    Read the article

  • Displaying data from mutliple arrays with codeigniter

    - by Craig Ward
    I am trying to display results from a database where the results are contained in three tables. How do I echo out the results? $p- works, but $img- or $branch- doesn't. What am I doing wrong? Example code is below Sample controller: $p_id = $this-uri-segment(3); $this-load-model('One_model'); $data['prop'] = $this-One_model-get_details($p_id); $data['img'] = $this-One-get_images($p_id); $this-load-model('Two_model'); $data['branch'] = $this-Two_model-get_details($p_id); $this-load-view('a_test_view', $data); A Sample View <?php foreach ($property as $p):?> <p><?php echo $p->SUMMARY; ?></p> <p>We have <?php echo "$img->num_photos"; ?> photos</p> <p>Branch is <?php echo $branch->name; ?>. Telephone <?php echo $branch->tel; ?></p> <ul> <li><?php echo $p->FEATURE1; ?></li> <li><?php echo $p->FEATURE2; ?></li> <li><?php echo $p->FEATURE3; ?></li> <li><?php echo $p->FEATURE4; ?></li> <li><?php echo $p->FEATURE5; ?></li> <li><?php echo $p->FEATURE6; ?></li> <li><?php echo $p->FEATURE7; ?></li> <li><?php echo $p->FEATURE8; ?></li> <li><?php echo $p->FEATURE9; ?></li> <li><?php echo $p->FEATURE10; ?></li> </ul> <?php endforeach; ?>

    Read the article

  • Alligning a multiline li in an ul

    - by user146780
    I have two li (points) on this page http://animactions.ca/Animactions/le_developpement_des_equipes_de_travail.php that take up two lines. I'm not sure how to properly align them so that they line up with the first line. I'm referring to this point: Renforcir la cohésion et l’esprit d’équipe pour un travail proactif et durable qui génère des rendements supérieurs. Thanks

    Read the article

  • how can i check all ul of nested checkboxes

    - by Mike
    Question: I have a category listing which some categories have children, I am trying to create a ALL category that when clicked, will check all sibling checkboxes in that same category. e.g; clicking ALL underneath the MUSIC category would check blues, jazz, rock n roll Code: HTML: <ul name="events-categories" id="events-categories"> <li><input type="checkbox" name="category-events" value="185" placeholder="" id="category-185" class="events-category"> CONVENTIONS <ul class="event-children"> <li><input type="checkbox" name="child-category-all" value="" class="events-child-category-all">ALL</li> <li><input type="checkbox" name="child-category-190" value="190" id="child-category-190" class="child events-child-category">SCIENCE</li> <li><input type="checkbox" name="child-category-191" value="191" id="child-category-191" class="child events-child-category">TECHNOLOGY</li> </ul> </li> <li><input type="checkbox" name="category-events" value="184" placeholder="" id="category-184" class="events-category"> MUSIC <ul class="event-children"> <li><input type="checkbox" name="child-category-all" value="" class="events-child-category-all">ALL</li> <li><input type="checkbox" name="child-category-189" value="189" id="child-category-189" class="child events-child-category">BLUES</li> <li><input type="checkbox" name="child-category-188" value="188" id="child-category-188" class="child events-child-category">JAZZ</li> <li><input type="checkbox" name="child-category-187" value="187" id="child-category-187" class="child events-child-category">ROCK N ROLL</li> </ul> </li> <li><input type="checkbox" name="category-events" value="186" placeholder="" id="category-186" class="events-category"> TRIBUTES</li> </ul>? CSS: .event-children { margin-left: 20px; list-style: none; display: none; }? jQuery So Far: /** * left sidebar events categories * toggle sub categories */ $('.events-category').change( function(){ console.log('showing sub categories'); var c = this.checked; if( c ){ $(this).next('.event-children').css('display', 'block'); }else{ $(this).next('.event-children').css('display', 'none'); } }); $('.events-child-category-all').change( function(){ var c = this.checked; if( c ){ $(this).siblings(':checkbox').attr('checked',true); }else{ $(this).siblings(':checkbox').attr('checked',false); } });? jsfiddle: http://jsfiddle.net/SENV8/

    Read the article

  • Properly create centered vertical navigation list with a hover image on both sides?

    - by Damainman
    I have a navigation list I placed inside of a , I am attempting to get an image that appears on both sides of a link when you hover. Basically a an arrow on each side of the link. I have managed to get the effect I am looking for with: <ul> <li style=""> <a href="#">Services</a> </li> <li> <a href="#">About</a> </li> <li> <a href="#">Media</a> </li> <li> <a href="#">FAQ</a> </li> <li> <a href="#">Portfolio</a> </li> <li> <a href="#">Contact</a> </li> </ul> .nav ul{ list-style:none; text-align:center; } .nav li:hover a:before, .nav li:hover a:after { content:url(../images/nav_bullet.png); } The end result will look like the following but with the list centered: link >> Hovered Link << link However I am not sure if that is the best way of going about it, and the image is too close to the text. I tried placing a margin and padding but that didn't work. To top of it off, the image is not vertically centered with the link text. Anyone know of a proper way to do this as I am just going by trial and error? Thank you in advance!

    Read the article

  • jQuery: Adding li element only if it not already there?

    - by Legend
    I am constructing an <li> element like this: var element = $("<li></li>") .html(mHTML) .attr('id', "elemid"); I am trying to add this element to a <ul> element only if it doesn't already exist. Any ideas on how to do this? Am I supposed to use contains() to see if the ul element contain the html and then decide? For instance, <ul id="elemul"> <li id="elemli1">Element 1</li> <li id="elemli2">Element 2</li> <li id="elemli3">Element 3</li> </ul> If I try adding Element 1, it should not add it. What should I do if its a longer string (not really long but about 150 characters). Do I go about using hashmaps?

    Read the article

  • fonts mac vs pc

    - by Kieran
    Hi all hope your having a good day/evening. Simple question, but maybe not so simple to answer. I have an unordered list, which i am using as a menu. The list items are floated right and sized due to an anchor tag inside them with a roll over. The last element is given a specific size to suck up any extra space. See the code snippits bellow. css ul.mainNav { width: 970px; display:block; background:black; clear:both; overflow:hidden;} ul.mainNav li { float: left; height:29px;} ul.mainNav li a { display: block; padding:7px 19px; color:#ffffff; background-color:#000; font-weight:bold; text-decoration:none; font-size:13px; } ul.mainNav li a:hover, ul.mainNav li a.selected { background-color:#ffff00; color:#000; } ul.mainNav li a.last{ text-align:center; padding: 7px 19px; width:58px;} html <ul class="mainNav" id="mainNav"> <li><a href="/Default.aspx">home</a></li> <li><a href="/About/">about</a></li> <li><a href="/News/">news</a></li> <li><a href="/Enter/Registration.aspx">enter SOYA 2010</a></li> <li><a href="/Categories/Film.aspx">categories</a></li> <li><a href="/Mentors/janChapman.aspx">mentors</a></li> <li><a href="/PastWinners/">past winners</a></li> <li><a href="/Awards/">awards nights</a></li> <li><a href="/Support/" class="last">contact</a></li> </ul> It is containted in a <div style="margin:0 auto;">...</div> to center on the menu on screen Now my problem is: On PC; firefox/ Safari /IE /Chrome are all displaying correctly. Take the same code to a Mac; Safari/ firefox are displaying the menu to be too short and the only thing i can point to is that the fonts may be smaller in widths. The width is currently set to 970px. My question is: How can i get it to display at the same widths without specifying exact widths for each list item? Any help would be appreciated. If my structure is wrong or it is just a mac thing that i will never solve(hope not). Cheers, KJ

    Read the article

  • How to get element order number

    - by martin-masiar
    Hello everyone, how can i get order number of some element by javascript/jquery? <ul> <li>Anton</li> <li class="abc">Victor</li> <li class="abc">Simon</li> <li>Adam</li> <li>Peter</li> <li class="abc">Tom</li> </ul> There is 3xli with abc class. Now I need to get order(sequence) number of Simon li. Thanks in advance

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >