Search Results

Search found 2953 results on 119 pages for 'charlene li'.

Page 27/119 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Checking data of all same class elements

    - by Tiffani
    I need the code to check the data-name value of all instances of .account-select. Right now it just checks the first .account-select element and not any subsequent ones. The function right now is on click of an element such as John Smith, it checks the data-name of the .account-select lis. If the data-names are the same, it does not create a new li with the John Smith data. If no data-names are equal to John Smith, then it adds an li with John Smith. This is the JS-Fiddle I made for it so you can see what I am referring to: http://jsfiddle.net/rsxavior/vDCNy/22/ Any help would be greatly appreciated. This is the Jquery Code I am using right now. $('.account').click(function () { var acc = $(this).data("name"); var sel = $('.account-select').data("name"); if (acc === sel) { } else { $('.account-hidden-li').append('<li class="account-select" data-name="'+ $(this).data("name") +'">' + $(this).data("name") + '<a class="close bcn-close" data-dismiss="alert" href="#">&times;</a></li>'); } }); And the HTML: <ul> <li><a class="account" data-name="All" href="#">All</a></li> <li><a class="account" data-name="John Smith" href="#">John Smith</a></li> </ul> <ul class="account-hidden-li"> <ul>

    Read the article

  • First tab doesnt show with Jquery UI Tabs using Cufon

    - by BoulderDave
    I'm using Cufon to render the font for my Jquery Tabs. A strange problem I'm finding is that with the first tab, the text isn't rendered. If I remove Cufon, the text is there, or if I remove jquery tabs (so that its just html list items) the text is there (properly rendered by cufon). There seems to be timing issue with the loading I think, where cufon renders the text, but then the jquery tabs css is applied, and perhaps they are 'breaking' each other. Anybody had this issue? $(document).ready(function() { Cufon.replace('.tab'); }); <ul class="tabnav"> <li><a href="bottoms.html" title="Bottoms"><div class="tab">Bottoms</div></a></li> <li><a href="tops.html" title="Tops"><div class="tab">Tops</div></a></li> <li><a href="skirts.html" title="Skirts"><div class="tab">Skirts</div></a></li> <li><a href="dresses.html" title="Dresses"><div class="tab">Dresses</div></a></li> <li><a href="shoes.html" title="Shoes"><div class="tab">Shoes</div></a></li> </ul>

    Read the article

  • css height and width problem.

    - by Reigel
    Hi, I have this HTML <div class="someClass"> <ul> <li><a href="index.html">1</a></li> <li><a href="index.html">2</a></li> <li><a href="index.html">3</a></li> <li><a href="index.html">4</a></li> <li><a href="index.html">5</a></li> </ul> </div> Problem: I want to make the <a>s to shape like a square, with height = 20px and width = 20px. I can make it have the height and width if I make it float: left. In there the problem occur cause I need the <ul> to be centered but it won't because of the float:left of the <a>. how can I make it centered with fix height and width of the anchors? note: anchors don't have fixed length... the sample is just 5, but it can also grow to 7, or 9. I also need the links to be inline in view.

    Read the article

  • Can I suppress newlines with Django's template engine?

    - by ento
    In Rails ERB, you can suppress newlines by adding a trailing hyphen to tags: <ul> <% for @item in @items -%> <li><%= @item %></li> <% end -%> </ul> becomes: <ul> <li>apple</li> <li>banana</li> <li>cacao</li> </ul> Is there a way to do this in Django? (Disclosure: I'm generating a csv file with Django)

    Read the article

  • JQuery form submit Question?

    - by SLAPme
    I'm kind of new to JQuery and was wondering how can I have the following text appear when the user submits there changes <p>Your changes have been saved.</p>? How do I fix my code so it displays this message? JQuery script. $(function() { $(".save-button").click(function() { $.post($("#contact-form").attr("action"), $("#contact-form").serialize(), function(html) { $("div.contact-info-form").html(html); }); return false; // prevent normal submit }); }); Here is the html. <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><label for="state_province">State/Province: </label> <?php echo '<select name="state_province" id="state_province">' . "\n"; foreach($state_options as $option) { if ($option == $state_province) { echo '<option value="' . $option . '" selected="selected">' . $option . '</option>' . "\n"; } else { echo '<option value="'. $option . '">' . $option . '</option>'."\n"; } } echo '</select>'; ?> </li> <li><label for="zipcode">Zip/Post Code: </label><input type="text" name="zipcode" id="zipcode" size="5" class="input-size" value="<?php if (isset($_POST['zipcode'])) { echo $_POST['zipcode']; } else if(!empty($zipcode)) { echo $zipcode; } ?>" /></li> <li><label for="country">Country: </label> <?php echo '<select name="country" id="country">' . "\n"; foreach($countries as $option) { if ($option == $country) { echo '<option value="' . $option . '" selected="selected">' . $option . '</option>' . "\n"; } else if($option == "-------------") { echo '<option value="' . $option . '" disabled="disabled">' . $option . '</option>'; } else { echo '<option value="'. $option . '">' . $option . '</option>'."\n"; } } echo '</select>'; ?> </li> <li><label for="email">Email Address: </label><input type="text" name="email" id="email" size="25" class="input-size" value="<?php if (isset($_POST['email'])) { echo $_POST['email']; } else if(!empty($email)) { echo $email; } ?>" /><br /><span>We don't spam or share your email with third parties. We respect your privacy.</span></li> <li><p>Changes have been saved</p><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>

    Read the article

  • How do I get the element after my horizontal css navigation bar to appear below it?

    - by Curyous
    I'm using a css unordered list to make a site navigation bar, using display: inline, display: block, and float: left. The next element that I put after the navigation bar is placed to the right of it. How can I align the next element so that it is displayed below? The html: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <link type="text/css" rel="stylesheet" href="/stylesheets/test.css" /> </head> <body> <div> <ul class="nav"> <li class="nav"><a class="nav" href="#">One1</a></li> <li class="nav"><a class="nav" href="#">Two</a></li> <li class="nav"><a class="nav" href="#">Three</a></li> <li class="nav"><a class="nav" href="#">Four</a></li> </ul> </div> <div><h2>Heading</h2></div> </body> </html> The css: ul.nav, ul li.nav { display: inline; margin: 0px; padding: 0px; } ul.nav { list-style-type: none; } li.nav { display: block; float: left; background-color: red; } a.nav { background-color: green; padding: 10px; margin: 0px; } a:hover.nav { background-color: gray; }

    Read the article

  • Read from file hexadecimal number and change their representation style

    - by user576844
    I want to write a program changing the notation of all hexadecimal numbers found in an assembly source file from traditional (h) to C-style (0x). I have started the coding part but am not sure how can I detect the hexadecimal numbers and eventually change the style and save it back in the file... I have started writing the program.. ## Mips program - .data fin: .ascii "" # filename for input msg0: .asciiz "aaaa" msg1: .asciiz "Please enter the input file name:" buffer: .asciiz "" .text #----------------------- li $v0, 4 la $a0, msg1 syscall li $v0, 8 la $a0, fin li $a1, 21 syscall jal fileRead #read from file move $s1, $v0 #$t0 = total number of bytes li $t0, 0 # Loop counter loop: bge $t0, $s1, end #if end of file reached OR if there is an error in the file lb $t5, buffer($t0) #load next byte from file jal checkhexa #check for hexadecimal numbers addi $t0, $t0, 1 #increment loop counter j loop end: jal output jal fileClose li $v0, 10 syscall fileRead: # Open file for reading li $v0, 13 # system call for open file la $a0, fin # input file name li $a1, 0 # flag for reading li $a2, 0 # mode is ignored syscall # open a file move $s0, $v0 # save the file descriptor # reading from file just opened li $v0, 14 # system call for reading from file move $a0, $s0 # file descriptor la $a1, buffer # address of buffer from which to read li $a2, 100000 # hardcoded buffer length syscall # read from file jr $ra Any help would be appreciated.

    Read the article

  • Can I suppress newlines after each template tag with Django's template engine?

    - by ento
    In Rails ERB, you can suppress newlines by adding a trailing hyphen to tags: <ul> <% for @item in @items -%> <li><%= @item %></li> <% end -%> </ul> becomes: <ul> <li>apple</li> <li>banana</li> <li>cacao</li> </ul> Is there a way to do this in Django? (Disclosure: I'm generating a csv file with Django) Edit: Clarified that the newlines I'm hunting down are the ones left behind after the template tags.

    Read the article

  • Quick question. Html.ActionLink and creating Internal Links ( #home, #about, etc. )

    - by Gary '-'
    Hi there, quick question... How can I best create internal links? This is the markup I want to achieve: <h3>Title</h3> <ul> <li><a href="#prod1">Product 1</li> <li><a href="#prod2">Product 2</li> <li><a href="#prod3">Product 3</li> ... <li><a href="#prod100">Product 100</li> </ul> <div id="prod1"> <!-- content here --> </div> Using MVC 2 I'm using, what's the best Html Helper to use? <h3><%= Html.Encode(Model.Title) %> <ul> <% foreach ( var item in Model.Categories ) {%> <li><%= Html.RouteLink( item.Description, ???? ) %></li> <%} %> </ul> What's the best way to get a url to an internal link? String.Format a link from scratch? There's gotta be a better way.

    Read the article

  • XHTML Strict 1.0 - target="_blank" not valid?

    - by Mutherphucker Mike
    I just validated my actual XHTML Strict 1.0 doc with the w3c validator service.. and it says that, <ul id="socialnetwork"> <li><a href="http://www.twitter.com" target="_blank"></a></li> <li><a href="http://www.flickr.com" target="_blank"></a></li> <li><a href="http://www.xing.com" target="_blank"></a></li> <li><a href="http://www.rss.com" target="_blank"></a></li> </ul> the target="_blank" is not valid.. but I need the target blank so a new tab will open in the browser, so that the user does not leave the main page. What can I do? Why is this not valid?

    Read the article

  • using '.each' method: how do I get the indexes of multiple ordered lists to each begin at [0]?

    - by shecky
    I've got multiple divs, each with an ordered list (various lengths). I'm using jquery to add a class to each list item according to its index (for the purpose of columnizing portions of each list). What I have so far ... <script type="text/javascript"> /* Objective: columnize list items from a single ul or ol in a pre-determined number of columns 1. get the index of each list item 2. assign column class according to li's index */ $(document).ready(function() { $('ol li').each(function(index){ // assign class according to li's index ... index = li number -1: 1-6 = 0-5; 7-12 = 6-11, etc. if ( index <= 5 ) { $(this).addClass('column-1'); } if ( index > 5 && index < 12 ) { $(this).addClass('column-2'); } if ( index > 11 ) { $(this).addClass('column-3'); } // add another class to the first list item in each column $('ol li').filter(function(index) { return index != 0 && index % 6 == 0; }).addClass('reset'); }); // closes li .each func }); // closes doc.ready.func </script> ... succeeds if there's only one list; when there are additional lists, the last column class ('column-3') is added to all remaining list items on the page. In other words, the script is presently indexing continuously through all subsequent lists/list items, rather than being re-set to [0] for each ordered list. Can someone please show me the proper method/syntax to correct/amend this, so that the script addresses/indexes each ordered list anew? many thanks in advance. shecky p.s. the markup is pretty straight-up: <div class="tertiary"> <h1>header</h1> <ol> <li><a href="#" title="a link">a link</a></li> <li><a href="#" title="a link">a link</a></li> <li><a href="#" title="a link">a link</a></li> </ol> </div><!-- END div class="tertiary" -->

    Read the article

  • rails add :prompt to form_tag fields?

    - by bob
    Hey guys, My question is simple. Can I add either of the blow :prompt => "Any" :include_blank => true to a form in form_tag. Here is an example. I would like to add :prompt to the select_tag :condition and select_tag :category fields and am having trouble. <ul id="homepage_searchbar"> <% form_tag junklists_path, :method => :get do %> <li> <%= image_tag('search_icon.png', :id => 'main_search_icon' ) %> </li> <li> <%= text_field_tag :search, "I'm looking for junk called...", :id => "main_field" %> </li> <li> <%= select_tag :condition, options_for_select(Condition.all.collect{|condition| [condition.name, condition.id]}) %> </li> <li> <%= select_tag :category, options_for_select(nested_set_options(Category) {|i| "#{'-' * i.level} #{i.name}"})%> </li> <li> <%= submit_tag "Go!", :name => 'main_submit', :id => "main_submit" %> </li> <% end %> </div> If I can't do it the way I want, how can I add a field at the top of the select boxes that has the text "Any" but has no value when the form is submitted? Thanks in advance!

    Read the article

  • Inline HTML Syntax for Helpers in ASP.NET MVC

    - by kouPhax
    I have a class that extends the HtmlHelper in MVC and allows me to use the builder pattern to construct special output e.g. <%= Html.FieldBuilder<MyModel>(builder => { builder.Field(model => model.PropertyOne); builder.Field(model => model.PropertyTwo); builder.Field(model => model.PropertyThree); }) %> Which outputs some application specific HTML, lets just say, <ul> <li>PropertyOne: 12</li> <li>PropertyTwo: Test</li> <li>PropertyThree: true</li> </ul> What I would like to do, however, is add a new builder methid for defining some inline HTML without having to store is as a string. E.g. I'd like to do this. <% Html.FieldBuilder<MyModel>(builder => { builder.Field(model => model.PropertyOne); builder.Field(model => model.PropertyTwo); builder.ActionField(model => %> Generated: <%=DateTime.Now.ToShortDate()%> (<a href="#">Refresh</a>) <%); }).Render(); %> and generate this <ul> <li>PropertyOne: 12</li> <li>PropertyTwo: Test</li> <li>Generated: 29/12/2008 <a href="#">Refresh</a></li> </ul> Essentially an ActionExpression that accepts a block of HTML. However to do this it seems I need to execute the expression but point the execution of the block to my own StringWriter and I am not sure how to do this. Can anyone advise?

    Read the article

  • Click outside menu to close in jquery

    - by George
    So I have a drop-down menu that shows on a click, as per business requirements. The menu becomes hidden again after you mouse away from it. But now I am being asked to have it stay in place until user clicks anywhere on the document. How can this be accomplished? This is a simplified version of what I have now: $(document).ready(function() { $("ul.opMenu li").click(function(){ $('#MainOptSubMenu',this).css('visibility', 'visible'); }); $("ul.opMenu li").mouseleave(function(){ $('#MainOptSubMenu',this).css('visibility', 'hidden'); }); }); <ul class="opMenu"> <li id="footwo" class=""> <span id="optImg" style="display: inline-block;"> <img src="http://localhost.vmsinfo.com:8002/insight/images/options-hover2.gif"/> </span> <ul id="MainOptSubMenu" style="visibility: hidden; top: 25px; border-top: 0px solid rgb(217, 228, 250); background-color: rgb(217, 228, 250); padding-bottom: 15px;"> <li>some</li> <li>nav</li> <li>links</li> </ul> </li> </ul> I tried something like this $('document[id!=MainOptSubMenu]').click(function() thinking it would trigger on anything that wasnt the menu, but it didnt work.

    Read the article

  • grabbing a substring while scraping with Python2.6

    - by Diego
    Hey can someone help with the following? I'm trying to scrape a site that has the following information.. I need to pull just the number after the </strong> tag.. [<li><strong>ISBN-13:</strong> 9780375853401</li>, <li><strong>Pub. Date: </strong> 05/11/2010</li>] [<li><strong>UPC:</strong> 490355000372</li>, <li><strong>Catalog No:</strong> 15024/25</li>, <li><strong>Label:</strong> CAMERATA</li>] here's a piece of the code I've been using to grab the above data using mechanize and BeautifulSoup. I'm stuck here as it won't let me use the find() function for a list br_results = mechanize.urlopen(br_results) html = br_results.read() soup = BeautifulSoup(html) local_links = soup.findAll("a", {"class" : "down-arrow csa"}) upc_code = soup.findAll("ul", {"class" : "bc-meta3"}) for upc in upc_code: upc_text = upc.contents.contents print upc_text

    Read the article

  • Pass deeply nested element to function in JQuery

    - by klez
    I have this form: <form action="contact.php" method="post" id="contactform"> <ol> <li> <label for="name">First Name * </label> <input id="name" name="name" class="text" /> </li> <li> <label for="email">Your email * </label> <input id="email" name="email" class="text" /> </li> <li> <label for="company">Company</label> <input id="company" name="company" class="text" /> </li> <li> <label for="subject">Subject</label> <input id="subject" name="subject" class="text" /> </li> <li> <label for="message">Message * </label> <textarea id="message" name="message" rows="6" cols="50"></textarea> </li> <li class="buttons"> <input type="image" name="imageField" id="imageField" src="images/send.gif" /> </li> </ol> </form> This javascript function that does some basic validation: function validateRequired(field,alerttxt) { with (field) { if (value==null||value=="") { alert(alerttxt); return false; } return true; } } And this script (written with jquery) to intercept the submit event jQuery(document).ready(function(){ $('#contactform').submit(function(){ ... }); }); The problem is that, inside the last script I want to call validateRequired passing each required input/textarea (namely: name, email and message) as first parameter. I tried like this: validateRequired($('#name')); but it doesn't work. How can I do this?

    Read the article

  • jquery - Create a List of all LIs Name's

    - by nobosh
    Given the following block of HTML: <ul id="taglist"> <li><a name="45" href="">Product 1</a></li> <li><a name="1146" href="">Product 2</a></li> <li><a name="13437" href="">Product 3</a></li> <li><a name="51" href="">Product 4</a></li> </ul> Is it possible for JQUERY to return a STRING, one variable with the name values: alert(tagliststring); Would alert: 45,1146,13437,51 Thanks

    Read the article

  • Prgramming jquery slider

    - by Mirage
    I want to program the jquery slider myself rather than using any plugin. But i want to know the basic idea. e.g I have <ul> <li> <div>content </div> </li> <li> <div>content </div> </li> <li> <div>content </div> </li> <li> <div>content </div> </li> <li> <div>content </div> </li> </ul> I want to show horzontally only three items at one time and there will be arroes left and right end. I know jquery basics. But i don't know how should i do in steps. I mean when click on right arrow The left div should slide left and new div com right should come left ANy ideas in sequence what i need to do

    Read the article

  • jQuery AJAX: How to pass large HTML tags as parameters?

    - by marknt15
    Hello, How can I pass a large HTML tag data to my PHP using jQuery AJAX? When I'm receiving the result it is wrong. Thanks in advance. Cheers, Mark jQuery AJAX code: $('#saveButton').click(function() { // do AJAX and store tree structure to a PHP array (to be saved later in database) var treeInnerHTML = $("#demo_1").html(); alert(treeInnerHTML); var ajax_url = 'ajax_process.php'; var params = 'tree_contents=' + treeInnerHTML; $.ajax({ type: 'POST', url: ajax_url, data: params, success: function(data) { $("#show_tree").html(data); }, error: function(req, status, error) { } }); }); treeInnerHTML actual value: <ul class="ltr"> <li id="phtml_1" class="open"><a href="#"><ins>&nbsp;</ins>Root node 1</a> <ul> <li class="leaf" id="phtml_2"><a href="#"><ins>&nbsp;</ins>Child node 1</a></li> <li class="last leaf" id="phtml_3"><a href="#"><ins>&nbsp;</ins>Child node 2</a></li> </ul> </li> <li id="phtml_5" class="file last leaf"><a href="#"><ins>&nbsp;</ins>Root node 2</a></li> </ul> Returned result from my show_tree div: <ul class="\&quot;ltr\&quot;"> <li id="\&quot;phtml_1\&quot;" class="\&quot;open\&quot;"><a href="%5C%22#%5C%22"><ins></ins></a></li></ul>

    Read the article

  • Adding a div layer on top of a jquery carousel. Tough one.

    - by wilwaldon
    Hey everyone, I have a tough one, well it's tough for me because I'm kinda new to the whole jQuery carousel thing, never built one before this project. Here's my problem. If you go to the TEST SITE you will see a scroller with a blue background about half way down the page. If you mouse onto the "data analytics" slide you should see a black box fade in. Here is my dilemma. I want that black box to be a menu that's connected to the data analytics slide. I've done a mock up for you so you can see what I'm talking about. Here is my scroller code. I'm using jCarousel. <div class="carousel"> <ul> <li> <div id="homeslide1"> testers sdfasdfasdfas asdftjhs iasndkad kasdnf <a href="#" id="#homeslide1-toggle">Close this</a> </div> <a href="#" id="homeslide1-show"><img src="<?php bloginfo('template_url'); ?>/images/home_data_analytics.jpg" width="200" height="94" /></a> </li> <li><img src="<?php bloginfo('template_url'); ?>/images/home_oem_partnerships.jpg" width="200" height="94" /></li> <li><img src="<?php bloginfo('template_url'); ?>/images/home_reporting.jpg" width="200" height="92" /></li> <li><img src="<?php bloginfo('template_url'); ?>/images/home_returning_lost_customers.jpg" width="200" height="92" /></li> <li><img src="<?php bloginfo('template_url'); ?>/images/home_sales.jpg" width="200" height="92" /></li> <li><img src="<?php bloginfo('template_url'); ?>/images/home_service_retention.jpg" width="200" height="92" /></li> </ul> Here is my scroller css /*HOMEPAGE SCROLLER*/ .carousel {!important padding:10px; width: 890px; margin: 0px 0px 0px 26px;} .carousel ul li element.style{height: 94px;} .carousel ul{width: 200px; padding: 5px;} .carouselitem{height: 94px;} .prev{background: url(images/home_left_scroll.png); height: 94px; width: 16px; text-indent: -999px; outline: none; cursor:pointer; float: left;} .next{background: url(images/home_right_scroll.png); height: 94px; width: 16px; text-indent: -999px; outline: none; cursor:pointer; float: right;} .carousel ul li{ padding: 0px 3px 0px 3px; margin: 0px; height:!important 94px; } .home_right_arrow{ width: 16px; float: right;} .home_left_arrow{ width: 16px; float: left;} .homeslide1{ width: 200px; height: 94px;} I've tried all sorts of z-index tricks but can't seem to figure it out on my own. If you solve this riddle I'll buy you a beer if we ever meet up. I'll also give you a high five through the internet. Is there a simple way to do this via jQuery? If so could you point me in the right direction? Thanks so much.

    Read the article

  • jQuery sortable drop within itself.

    - by Janis Peisenieks
    So my question here is: Can I place a sortable element within another sortable element of the same level. Example: <ul class="sortable"> <li class="subsortable">Some text</li> <li class="subsortable">Some text</li> </ul> into: <ul class="sortable"> <li class="subsortable">Some text<li class="subsortable">Some text</li></li> </ul> I've been trying to do this for a day now, and I can't seem to find a way to do this.

    Read the article

  • Is my slide-to-anchor jQuery routine a correct use of JavaScript, or is there a better way?

    - by Stuart Robson
    I'm currently working on a project with a one page design that'll slide up and down between sections on an <a href> link... Currently, i have it written as follows: <ul> <li><a href="javascript:void(0)" onClick="goToByScroll('top')">home</a></li> <li><a href="javascript:void(0)" onClick="goToByScroll('artistsmaterials')">artist's materials</a></li> <li><a href="javascript:void(0)" onClick="goToByScroll('pictureframing')">picture framing</a></li> <li><a href="javascript:void(0)" onClick="goToByScroll('gallery')">gallery</a></li> <li><a href="javascript:void(0)" onClick="goToByScroll('contactus')">contact us</a></li> </ul> ...with the most relevant portion being the links: <a href="javascript:void(0)" onClick="goToByScroll('contactus')"> Then in a .js file I have: function goToByScroll(id){ $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow'); } Is this ok? Or should this be done a different way?

    Read the article

  • jQuery UI - Sortable isn't firing?

    - by Kenny Bones
    Hi, I'm trying to get the jQuery UI sortable plugin to work and I've created a list that looks like this: <ul id="sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> </ul> And I've included the plugin script files: $(function() { $("#sortable").sortable(); alert('test'); $("#sortable").disableSelection(); }); So I just tried putting the alert box before .sortable is run and the alertbox is showing. But putting it after .sortable isn't working. Which means that .sortable is failing right? I've included the scripts and put them in the head of the html document. <script type="text/javascript" src="js/jquery.ui.core.min.js"></script> <script type="text/javascript" src="js/jquery.ui.mouse.min.js"></script> <script type="text/javascript" src="js/jquery.ui.sortable.min.js"></script> <script type="text/javascript" src="js/jquery.ui.widget.min.js"></script> Which is correct right? And the function that actually runs .sortable is in a merged js file along with all other js snippets and plugins.

    Read the article

  • centering a div without setting width

    - by Daniel
    Is there a way to do this? When using navigation that can change the number of items often, it would be nice not having to calculate the with and updating the css, but just having a solution that works. if that's impossible (I'm assuming it is) can anyone point me to a javascript that can do this? edit re: provide code some code basically I'm working with, what I think is, the most typical setup <div class="main"> <div class="nav"> <ul> <li>short title</li> <li>Item 3 Long title</li> <li>Item 4 Long title</li> <li>Item 5 Long title</li> <li>Item 6 Extra Long title</li> </ul> </div> </div> edit .main { width:100%; text-align:center; } .nav { margin:0 auto; } .nav ul li { display:inline; text-align:left; } the issue I've found with this/these solutions is that the content is nudged to the right adding some right padding (of 40px) seems to fix this across the browsers I'm checking on (O FF IE). .nav { margin:0 auto; padding-right:40px; } I don't know where this value is coming from though and why 40px fixes this. Does anyone know where this is coming from? it's not a margin or padding but no matter what I do the first about 40px can not be used for placement. Maybe it's the ul or li that's adding this. I've had a look at the display:table-cell way of doing this, but there's that complication with IE and it still has the same issue as the other solution edit (final) okay I've tried some things in regard to the indent. I've reset all padding to 0 *{padding:0;} that fixed it, and I don't need to offset the padding (I think I'll leave my whole process up so if anyone comes across this, it'll save them some time) thanks for the comments and replies

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >