Search Results

Search found 3823 results on 153 pages for 'andy li'.

Page 20/153 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Getting the first image elements id within an unordered list using JQuery

    - by Roland
    I'm trying to get the id of the first element of an unordered list using JQuery. Here's the list <ul class="list"> <li><img id="1" src="image1.jpg" name="image1" /></li> <li><img id="2" src="image2.jpg" name="image2" /></li> <li><img id="3" src="image3.jpg" name="image3" /></li> <li><img id="4" src="image4.jpg" name="image4" /></li> <li><img id="5" src="image5.jpg" name="image5" /></li> </ul> JQuery var id = $('.list li img'):first.attr('id');

    Read the article

  • How can I collapse a nested list using jQuery?

    - by Bradley Herman
    I have a nested list: <ul> <li><a href='#'>stuff</a></li> <li><a href='#'>stuff2</a></li> <ul> <li><a href='#'>stuff3</a></li> </ul> <li><a href='#'>stuff4</a></li> </ul> ...and want to collapse the nested ul when the li is clicked. Before I was using $('UL LI').click(function(){ $(this).next().slideToggle(); }); ...but this obviously causes a problem when a li doesn't have a ul nested after it. Is there a better way to do this, or is there a way for me to determine if the object returned by $(this).next() is a UL?

    Read the article

  • Why this mouseout will be called when i move out of li instead of ul?

    - by terry
    i want to call mouseout of ul tag, but it looks it will call mouseout as well when i move between two li tags, what's wrong? how can i make it work when i move mouse out of the ul? thanks a lot! $(document).ready(function(){ $("#info").live("mouseout", function(){ console.log('mouseout'); }); }); HTML <div id="latest"> <ul id="info"> <li>test1</li> <li>test2</li> </ul> </div>

    Read the article

  • How to display an HTML list non-nested?

    - by Georg
    Here's the HMTL <ul> <li>Salads</li> <li>Fruits <ul> <li>Apples</li> <li>Prunes</li> </ul> </li> <li>Main Course</li> </ul> Here's what it looks like now: Salads Fruits Apples Prunes Main Course And here's what I'd like it to look like: Salads Fruits Main Course Apples Prunes How can I achieve this, without modifying the HTML? Current CSS: ul { list-style:none; display:block; } li { display:inline-block; }

    Read the article

  • issue in jquery radio button selection

    - by Sri
    I am not much more flexible with jquery. I have some li tags and for each li tag, I have one input tag of type radio like: <li><input type='radio' value='cool' name='radiooption' id='2'>2</li> <li class='answered'><input type='radio' name='radiooption' value='cool1' id='3'>3</li> <li><input type='radio' value='cool' name='radiooption' id='4'>4</li> <li><input type='radio' value='cool' name='radiooption' id='2'>5</li> Now by jquery how to add checked="checked" for radio button which is under li tag having class='answered'? Please guide me.

    Read the article

  • JQuery .each() backwards

    - by Jack Mills
    Hi, I'm using JQuery to select some elements on a page and then move them around in the DOM. The problem I'm having is I need to select all the elements in the reverse order that JQuery naturally wants to select them. For example: <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> </ul> I want to select all the li items and use the .each() command on them but I want to start with Item 5, then Item 4 etc. Is this possible? Thanks

    Read the article

  • adv. styling list with css

    - by Ayrton
    Hi I need to style a regular html list like the following picture: as you see each each list item has a padding on the sides and a top&bottom border. When hovered the border has a width of 100% of the <ul> item. Now the problem actually is: when you give each <li> element a top & bottom border I have a border of 2 px between each element (bottom border from the first element and the top border from the second element), I don't want that however I do not know any solution for this. my html: <div id="tab_top" class="tab"> <div class="bottom"> <div class="cont"> <ul> <li><a href="#">Here’s a Sample Post <span class="ct">32</span></a></li> <li><a href="#">Here’s a Sample Post <span class="ct">32</span></a></li> <li><a href="#">Here’s a Sample Post <span class="ct">32</span></a></li> <li><a href="#">Here’s a Sample Post <span class="ct">32</span></a></li> <li><a href="#">Here’s a Sample Post <span class="ct">32</span></a></li> <li><a href="#">Here’s a Sample Post <span class="ct">32</span></a></li> <li><a href="#">Here’s a Sample Post <span class="ct">32</span></a></li> </ul> </div> </div> </div> my css: #tabs .tab div.cont ul li a{line-height:30px; height:30px; color:#3ca097; display:block; padding-left:11px; padding-right:13px; width:259px;} #tabs .tab div.cont ul li a span.ct{float:right;background:url(images/count_comments.gif) no-repeat left top; height:13px; padding-left:16px; margin-top:10px; line-height:12px;} #tabs .tab div.cont ul li a:hover{color:#fff; background-color:#6fd2c8; border-top:1px solid #7db9b2; border-bottom:1px solid #7db9b2; height:28px; line-height:28px;} #tabs .tab div.cont ul li a:hover span.ct{background-position:left bottom; color:#23665f; margin-top:9px;} I would be pleased if you can help me Yours truthfully

    Read the article

  • ie9/CSS: Flyout menu not working in ie9, but looks great in Firefox/Chrome

    - by Brandon
    Please see this flyout menu: http://www.caseen.com/store.html. It looks amazing in both Firefox and Chrome, but not in IE9! Trying to see what is going on =(. It looks like ie9 is completing ignoring the stylesheet, but in error checking and clicking ie9 direct mode, it shows up however VERY ugly with huge nasty white borders around the links! Please see my code: <div class="flyout"> <ul> <!--START: CATEGORIES--> <!--START: CATEGORY_FORMAT--> <li><a href="view_category.asp?cat=CATID">&nbsp;CATEGORY</a> <!--END: CATEGORY_FORMAT--> <ul><!--START: SUB_CATEGORY_FORMAT--> <li><a href="view_category.asp?cat=CATID">&nbsp;CATEGORY</a></li> <!--END: SUB_CATEGORY_FORMAT--></ul> <!--END: CATEGORIES--> </li> </ul> </div> AND CSS .flyout { width: 130px; height: auto; position:relative; margin: -10 0; padding: 0; z-index:10000; } .flyout ul li a { display:block; text-decoration:none; color: #fff; width: 130px; border: solid; border-color: #000; border-width: 0 0 0 5px; text-align:left; font-size:12px; line-height: 25px; } .flyout ul { padding:0px; list-style-type: none; } .flyout ul li { float:left; margin-right:1px; position:relative; } .flyout ul li ul { display: none; } .flyout ul li:hover a { border: solid; border-color: #fff; border-width: 0 2 0 5px; color: #60dfe5; } .flyout ul li:hover ul { display:block; position:absolute; top:0; left:130px; width:10px; } .flyout ul li:hover ul li a.hide { background:#000; color:#fff; } .flyout ul li:hover ul li:hover a.hide {width:180px;} .flyout ul li:hover ul li ul {display: none;} .flyout ul li:hover ul li a { display:block; background:#000; color:#60dfe5; width:200px; } .flyout ul li:hover ul li a:hover { background:#000; color:#fff; } Thanks, Brandon

    Read the article

  • CSS - Can't get the z-index to apply correctly in Internet Explorer

    - by peaki
    I've written a jQuery script to replace <select /> elements with some DIV's and UL's allowing my to simulate the original SELECT but also allow me to style it. So far, aside from a few minor bugs, it works rather nicely. However, in Internet Explorer, the 'options' div is getting rendered underneath the elements below the div. Here's the HTML: <div class="styledSelect-parent" style="display: inline-block; width: 59px;"> <div class="styledSelect-newSelect" style="position: relative;"> <input class="styledSelect-newSelect-selector" style="width: 59px;" readonly="readonly" name="hello" value="Test1" type="text"> <div class="styledSelect-newSelect-options" style="display: none; z-index: 20; width: 59px; position: absolute; left: 0px; top: 18px;"> <ul> <li>Test1</li> <li>Test2</li> <li>Test3</li> <li class="styledSelect-active">Test4</li> <li>Test1</li> <li>Test2</li> </ul> </div> </div> </div> <br /><br /> <div class="styledSelect-parent" style="display: inline-block; width: 59px;"> <div class="styledSelect-newSelect" style="position: relative;"> <input class="styledSelect-newSelect-selector" style="width: 59px;" readonly="readonly" name="hello" value="Test1" type="text"> <div class="styledSelect-newSelect-options" style="display: none; z-index: 20; width: 59px; position: absolute; left: 0px; top: 18px;"> <ul> <li class="styledSelect-active">Test1</li> <li>Test2</li> <li>Test3</li> </ul> </div> </div> </div> If I open the first select, the LI list sits underneath the second select box rather than above it. I can't get the z-indexes to work properly. What am I missing? :/

    Read the article

  • Javascript: Check if checkboxes are selected on page load and add a class to parent html li

    - by BoDiE2003
    Im looking a way to do it with prototype, this js, needs to loads with the page and interate over all the elements (inputs - checkboxes, in this case) with the given id and assign a class to its parent <li></li> The JS is: function changeSelectionStyle(id) { var inputId = id.substr(0,id.length-2); if(document.getElementById(inputId).checked){document.getElementById(id).className = 'yes';} alert(document.getElementById(inputId).checked); /* * if(document.getElementById(id).className != 'yes'){ * document.getElementById(id).className = 'yes'; * } else{document.getElementById(id).className = '';} */ } And the HTML (piece of it) that interacts with this JS is: <li id="selectedAuthorities-4_1li"> <input type="checkbox" id="selectedAuthorities-4_1" name="selectedAuthorities" value="ROLE_ADD_COMMENT_TO_CV" checked="checked" onclick="changeSelectionStyle(this.id + 'li'); checkFatherSelection(this.id);"> <a href="#" onclick="document.getElementById('selectedAuthorities-4_1').click(); return false;"> Agregar comentario <samp><b></b>Permite agregar comentario en el detalle</samp> </a> </li> After iteration, checking is the checkbox is checked, it has to add the class="yes" to the <li id="selectedAuthorities-4_1li">

    Read the article

  • Handy ASP.NET MVC 2 Extension Methods &ndash; Where am I?

    - by Bobby Diaz
    Have you ever needed to detect what part of the application is currently being viewed?  This might be a bigger issue if you write a lot of shared/partial views or custom display or editor templates.  Another scenario, which is the one I encountered when I first started down this path, is when you have some type of menu and you’d like to be able to determine which item represents the current page so you can highlight it in some way.  A simple example is the menu that is created as part of the default ASP.NET MVC 2 Application template.   <div id="menucontainer">       <ul id="menu">         <li><%= Html.ActionLink("Home", "Index", "Home") %></li>         <li><%= Html.ActionLink("About", "About", "Home") %></li>     </ul>   </div>   The part that got me at first, however, was the following entry in the default style sheet (Site.css):   ul#menu li.selected a {     background-color: #fff;     color: #000; }   I assumed that the .selected class would automatically get applied to the active menu item.  After trying a few different things, including the MvcContrib MenuBuilder, I decided to write my own extension methods so I would have more control over the output.  First, I needed a way to determine what view the user has navigated to based on the requested URL and route configuration.  Now, I am sure there are many ways to do this, but this is what I came up with:   public static class RequestExtensions {     public static bool IsCurrentRoute(this RequestContext context, String areaName,         String controllerName, params String[] actionNames)     {         var routeData = context.RouteData;         var routeArea = routeData.DataTokens["area"] as String;         var current = false;           if ( ((String.IsNullOrEmpty(routeArea) && String.IsNullOrEmpty(areaName)) ||               (routeArea == areaName)) &&              ((String.IsNullOrEmpty(controllerName)) ||               (routeData.GetRequiredString("controller") == controllerName)) &&              ((actionNames == null) ||                actionNames.Contains(routeData.GetRequiredString("action"))) )         {             current = true;         }           return current;     }       // additional overloads omitted... }   With that in place, I was able to write several UrlHelper methods that check if the supplied values map to the current view.   public static class UrlExtensions {     public static bool IsCurrent(this UrlHelper urlHelper, String areaName,         String controllerName, params String[] actionNames)     {         return urlHelper.RequestContext.IsCurrentRoute(areaName, controllerName, actionNames);     }       public static string Selected(this UrlHelper urlHelper, String areaName,         String controllerName, params String[] actionNames)     {         return urlHelper.IsCurrent(areaName, controllerName, actionNames)             ? "selected" : String.Empty;     }       // additional overloads omitted... }   Now I can re-work the original menu to utilize these new methods.  Note: be sure to import the proper namespace so the extension methods become available inside your views!   <div id="menucontainer">       <ul id="menu">         <li class="<%= Url.Selected(null, "Home", "Index") %>">             <%= Html.ActionLink("Home", "Index", "Home")%></li>           <li class="<%= Url.Selected(null, "Home", "About") %>">             <%= Html.ActionLink("About", "About", "Home")%></li>     </ul>   </div>   If we take it one step further, we can clean up the markup even more.  Check out the Html.ActionMenuItem() extension method and the refined menu:   public static class HtmlExtensions {     public static MvcHtmlString ActionMenuItem(this HtmlHelper htmlHelper, String linkText,         String actionName, String controllerName)     {         var html = new StringBuilder("<li");           if ( htmlHelper.ViewContext.RequestContext                 .IsCurrentRoute(null, controllerName, actionName) )         {             html.Append(" class=\"selected\"");         }           html.Append(">")             .Append(htmlHelper.ActionLink(linkText, actionName, controllerName))             .Append("</li>");           return MvcHtmlString.Create(html.ToString());     }       // additional overloads omitted... }   <div id="menucontainer">       <ul id="menu">         <%= Html.ActionMenuItem("Home", "Index", "Home") %>         <%= Html.ActionMenuItem("About", "About", "Home") %>     </ul>   </div>   Which generates the following HTML:   <div id="menucontainer">       <ul id="menu">         <li class="selected"><a href="/">Home</a></li>         <li><a href="/Home/About">About</a></li>     </ul>   </div>     I have created a codepaste of these extension methods if you are interested in using them in your own projects.  Enjoy!

    Read the article

  • HTML/CSS - How can I position these nested unordered lists correctly?

    - by Samuroid
    I am looking for some help resolving an issue im having with positioning the following unordered list elements that are contained in a div which has relative positioning: The html structure of the UL: <div id="accountBox" class="account_settings_box"> <ul> <ul> <li class="profileImage"><img src="images/profileimage.jpg" alt="Profile Image" /></li> <li class="profileName">Your name</li> <li class="profileEmail">Your email</li> </ul> <li><a href="">Messages</a></li> <li><a href="">Settings</a></li> <li><a href="">Password</a></li> <li><a href="">Sign out</a></li> </ul> </div> and the CSS for this list: .account_settings_box ul ul { display: inline-block; margin: 0; padding: 0; width: 100%; height: 150px; outline: 1px solid blue; } .account_settings_box ul ul li { display: inline-block; border: none; /* Reset the border */ } .profileImage { float: right; display: block; width: 150px; height: 150px; outline: 1px solid purple; } .profileName, .profileEmail { width: auto; height: auto; width: 150px; height: 150px; } .account_settings_box ul ul li:hover { outline: 1px solid red; } .profileImage img { width: 150px; height: 150px; } I am having difficultly with the embedded ul, i.e, .account_settings_box ul ul element. The image below shows what it currently looks like. I am trying to achieve the follow: Have the image floating to the right, and have the "your name" and "your email" positioned to the left of the image (basically where they are currently). Thanks for your help in advance. Sam :)

    Read the article

  • jQuery hide ul header when all entries are deleted...

    - by Scott
    I'm a noob with jQuery...and I hope I've explained this well enough; I have a <ul> header that appears when I've added an entry to a dynamically created list using $.post. Each entry added has a delete/edit button associated with it. Header is this: <ul class="header"> <li>Month</li> <li>Year</li> <li>Cottage</li> </ul> My dynamic list that is created: <ul class="addedItems"> <li>Month</li> <li>Year</li> <li>Cottage</li> <li><span class="edit">edit</span></li> <li><span class="del">delete</span></li> </ul> This all looks like this: Month Year Cottage <--this appears after I've added an entry -------------------------------- and I want it to stick around unless all items are deleted. Dec 1990 Fir edit/delete <--entries Jan 2000 Willow edit/delete My question is: Is there some kind of conditional that I can use with jQuery to hide the class="header" if all the items are deleted? I've read up on conditional statements like is and not with jq but I'm not really understanding how they work. All of the items in class="addedItems" is stored in data produced by JSON. This is the delete function: $(".del").live("click", function(){ var del = this; var thisVal = $(del).val(); $.post("delete.php", { dirID : thisVal }, function(data){ if(confirm("Are you sure you want to DELETE this entry?") == true) { if(data.success) { //hide the class="header" here somwhere?? $(del).parents(".addedItems").hide(); } else if(data.error) { // throw error if item does not delete } } }, "json"); return false; }); //end of .del function Here is the delete.php <?php if($_POST) { $data['delID'] = $_POST['dirID']; $query = "DELETE from //tablename WHERE dirID = '{$data['delID']}' LIMIT 1"; $result = $db->query($query); if($result) { $data['success'] = true; $data['message'] = "Entry was successfully removed."; } else { $data['error'] = true; $data['message'] = "Item could not be deleted."; } echo json_encode($data); } ?>

    Read the article

  • simple jquery dropdown - clearTimeout, setTimeout issues

    - by user210757
    HTML: <ul class="topnav"> <li><a href="#"><span>One</span></a></li> <li><a href="#"><span>Two</span></a></li> <li> <li><a href="#"><span>Three</span></a></li> <ul class="subnav"> <li><a href="#">A</a></li> <li><a href="#">B</a></li> <li><a href="#">C</a></li> </ul> </li> </ul> jquery: var timeout = null; $(document).ready(function() { $("ul.topnav li").mouseover(function() { if (timeout) clearTimeout(timeout); $(this).find("ul.subnav").slideDown('fast').show(); }).mouseout(function() { timeout = setTimeout(closemenu, 500); }); // sub menu mouseovers keep dropdown open $("ul.subnav li").mouseover(function() { if (timeout) clearTimeout(timeout); } ).mouseout(function() { timeout = setTimeout(closemenu, 500); // alert(timeout); }); // any click closes $(document).click(closemenu); }); // Closes all open menus function closemenu() { $('ul.subnav:visible').hide(); if (timeout) clearTimeout(timeout); } I'm having issues with timeout. In use, if i mouseover "Three", the dropdown stays out forever. if i mouseover "A", dropdown will stay out forever, but if I mouseover "B" or anything lower, the menu will close on me. if you uncomment "// alert(timeout);" it gets there for B, (and A) but timeout will have a value. why is this? i thought clearTimeout would null the timeout variable?

    Read the article

  • Drupal Override Custom Menu Template

    - by JaZz
    Hi Guys, I created a custom menu called "sub-top-nav" and now I'd like to override the html output. In particular I would like to add an unique class to each item like. This is how it looks atm: <div class="clear-block block block-menu" id="block-menu-menu-sub-top-nav"> <div class="content"> <ul class="menu"> <li class="leaf first"><a title="Test 1" href="/test1">Test 1</a></li> <li class="leaf"><a title="Test 2" href="/test2">Test 2</a></li> <li class="leaf active-trail"><a class="active" title="Test 3" href="/test3">Test 3</a></li> <li class="leaf last"><a title="Test 4" href="/test4">Test 4</a></li> </ul> </div> </div> And I'd like to change it into: <div class="clear-block block block-menu" id="block-menu-menu-sub-top-nav"> <div class="content"> <ul class="menu"> <li class="leaf test1 first"><a title="Test 1" href="/test1">Test 1</a></li> <li class="leaf test2"><a title="Test 2" href="/test2">Test 2</a></li> <li class="leaf test3 active-trail"><a class="active" title="Test 3" href="/test3">Test 3</a></li> <li class="leaf test4 last"><a title="Test 4" href="/test4">Test 4</a></li> </ul> </div> </div> This would give me more styling power. Any idea how that works? Thanks in advance!

    Read the article

  • Javascript InnerHTML Erases Data In Form Elements

    - by Jordan
    I have this form with a button that allows you to add fields to the form. <form id="contact" name="contactForm" action="newPoll.php" method="post"> <fieldset> <legend>Create A Poll</legend><br style="clear:both;"> <ol> <li><lable for=pollTitle>Poll Title:</lable><input name="pollTitle" id="pollTitle" type="text" size="66" /> </li> <li><lable for=question>1st Question:</lable><input name="question" id="question" type="text" size="66" /> </li> <li><lable for=answerType>Constrained:</lable><input name="answerType" id="answerType" value="Constrained" type="radio" size="66" /><span style="margin: 0 0 0 40px;"> Unconstrained: <input style="margin-right: 30px;" name="answerType" value="Unconstrained" id="question" type="radio" size="66" /></span>(Allow multiple answers) </li> <li><lable for=answer1>Answer:</lable><input name="answer1" id="answer1" type="text" size="66" /> </li> <li><lable for=answer2>Answer:</lable><input name="answer2" id="answer2" type="text" size="66" /> </li> <li><lable for=answer3>Answer:</lable><input name="answer3" id="answer3" type="text" size="66" /> </li> <li><lable for=answer4>Answer:</lable><input name="answer4" id="answer4" type="text" size="66" /> </li> </ol><br /> </fieldset> <input type="button" value="Add More Answers" name="addAnswer" onClick="generateRow()" /><input type="submit" name="submit" value="Add Another Question"> </form> And here is generateRow(): var count = 5; function generateRow() { var d=document.getElementById("contact"); var b = document.getElementById("answer4"); var c =b.name.charAt(0); var f = b.name.substr(0, 6); var y = f + count; count = count + 1; d.innerHTML+='<li><lable for=' + y + '>Answer:</lable><input name="' + y + '" id="' + y + '" type="text" size="66"/> </li>'; } The issue is whenever a new row is added, it erases any input that may have been typed in any of the un-original (added) text fields. It should leave the data in form elements

    Read the article

  • How can I position some divs inside an unordered list so they line up with the root element of the l

    - by Ronedog
    I want to position all the divs to line up to the left on the same x coordinate so it looks nice. Notice the picture below, how based on the number of nested categories the div (and its contents) show up at slightly different x coordinates. I need to have the div's line up at exactly the same x coordinate no matter how deeply nested. Note, the bottom most category always has a div for the content, but that div has to be situated inside the last < li . I am using an unordered list to display the menu and thought the best solution would be to grab the root category (Cat 2, and mCat1) and obtain their left offset using jquery, then simply use that value to update the positioning of the div...but I couldn't seem to get it to work just right. I would appreciate any advice or help that you are willing to give. Heres the HTML <ul id="nav> <li>Cat 2 <ul> <li>sub cat2</li> </ul> </li> <li>mCat1 <ul> <li>Subcat A <ul> <li>Subcat A.1 <ul> <li>Annie</li> </ul> </li> </ul> </li> </ul> </li> </ul> Heres some jquery I tried (I have do insert the div inside this .each() loop in order to retrieve some values, but basically, this selector is grabbing the last < li in the menu tree and placing a div after it and that is the div that I want to position. the 245 value was something I was playing around with to see how I could get things to line up, and I know its out of wack, but the problem is still the same no matter what I do: $("#nav li:not(:has(li))").each(function () { var self = $(this); var position = self.offset(); var xLeft = Math.round(position.left)- 245; console.log("xLeft:", xLeft ); self.after( '<div id="' + self.attr('p_node') + '_p_cont_div" class="property_position" style="display:none; left:' + xLeft + 'px;" /> ' ); }); Heres the css: .property_position{ float:left; position: relative; top: 0px; padding-top:5px; padding-bottom:10px; }

    Read the article

  • jQuery dialog width resizing problem

    - by ktMen
    I try to load some HTML code into a jQueryUI dialog by AJAX. The code itself is a list, where rightmost elements should be absolutely positioned so that the list looks like a table with two columns, but only in some rows. The problem is that jQueryUI plugin does not seem to be correctly resizing the dialog's width, which I think is due to the absolute positioning of some li's. I have read some answers to other similar questions, but none helped me out with this. This is the code I load: <style type="text/css"> ul {list-style-type:none;margin:0px;padding:0px;} ul ul {margin:0px;padding:0px;} ul>li.fila {margin-bottom:5px;padding-bottom:5px;} ul li.fila ul li { display:inline; padding-left:20px; position:relative; margin-bottom:10px; } ul li.fila ul li.O { background:url(bullet.gif) 5px 8px no-repeat; list-style-position:inside; } </style> <ul id="raiz" > <li class="fila"> <ul > <li style="position:absolute;left:0px;" class="O"> <label for="col1">Col1:</label> <input type="text" name="col1" id="col1" value="vCol1" class="text ui-widget-content ui-corner-all" /> </li> <li style="left:250px;" class="O" > <label for="col2">Col2:</label> <input type="text" name="col2" id="col2" value="vCol2" class="text ui-widget-content ui-corner-all" /> </li> </ul> </li> <li class="fila"> <ul > <li> <label for="col3">Col3:</label> <input type="text" name="col3" id="col3" value="vCol3" class="text ui-widget-content ui-corner-all" /> </li> </ul> </li> </ul> And the Dialog constructor: $("#dialog").dialog({ bgiframe: true, autoOpen: false, height: 'auto', width: 'auto', modal: true, buttons:{ 'Cancel': function() { $(this).dialog('close'); } }, open: function(event,ui){ $("#dialog").load("dialogCode.html"); } }); Thanks in advance for any suggestions.

    Read the article

  • not able to add list item between a list using jquery

    - by Pradyut Bhattacharya
    Hi I m having a ordered list having the structure Test another test Add I want to add a list item between sublist 2 and 3 using jquery I used the code: - $("ol#update li ol li:eq(1)").append("<li> test </li>"); But this appends inside the li "another test" and not after the 2 li Here is the example page On-click "sub-comment" adds a li inside li 2 Clicking on "comment" shows the structure of the sub lis Please help Thanks Pradyut

    Read the article

  • I have a bunch of images being shown on click via JQuery - any easy way to animate this?

    - by Cenk
    This is the (quite simple) JS code I'm using: $(document).ready(function() { $(".button-list .next").click(function() { project = $(this).parents().filter(".projektweb").eq(0); currentimg = project.find(".images-list li.current"); nextimg = currentimg.next(); firstimg = project.find(".images-list li:first"); currentimg.removeClass("current"); if (nextimg.is("li")) nextimg.addClass("current"); else firstimg.addClass("current"); return false; }); $(".button-list .prev").click(function() { project = $(this).parents().filter(".projektweb").eq(0); currentimg = project.find(".images-list li.current"); previmg = currentimg.prev(); lastimg = project.find(".images-list li:last"); currentimg.removeClass("current"); if (previmg.is("li")) previmg.addClass("current"); else lastimg.addClass("current"); return false; }); }); And this is how the HTML code for the image list looks like: <ul class="images-list"> <li class="current"><img src="img/1.jpg" alt="" /></li> <li><img src="img/1b.jpg" alt="" /></li> </ul> <ul class="button-list"> <li><a class="button prev" href="#">?</a></li> <li><a class="button next" href="#">?</a></li></ul> The CSS: .images-list { height: 460px; list-style-type:none; float:left; width: 460px; overflow:hidden; position:relative; } .images-list img { height: 460px; width: 460px; display:block; } .images-list li { display:none; } .images-list li.current { display:block; } What I'd like to do is animate the images as they come and go - right now they just appear, which is OK but a bit more eye-candy would be nice. Can anyone help me out here? It it even possible to do it this way? Thanks!!

    Read the article

  • Collpasible menu needs all header needs to be closed on initial loading

    - by Maju
    I have a sidebar with collapsible menu it works fine but all the values come expanded the initial loading time.I want it to be closed on load and toggled thereafter. Here is the jquery used // Sidebar Toggle var fluid = { Toggle : function(){ var default_hide = {"grid": true }; $.each( ["pagesnav", "commentsnav", "userssnav", "imagesnav"], function() { var el = $("#" + (this == 'accordon' ? 'accordion-block' : this) ); if (default_hide[this]) { el.hide(); $("[id='toggle-"+this+"']").addClass("hidden"); } $("[id='toggle-"+this+"']") .bind("click", function(e) { if ($(this).hasClass('hidden')){ $(this).removeClass('hidden').addClass('visible'); el.slideDown(); } else { $(this).removeClass('visible').addClass('hidden'); el.slideUp(); } e.preventDefault(); }); } ); } } jQuery(function ($) { if($("[id^='toggle']").length){fluid.Toggle();} }); here is the html <span class="ul-header"><a id="toggle-pagesnav" href="#" class="toggle visible">Content</a></span> <ul id="pagesnav"> <li><a class="icn_manage_pages" href="#">Manage Pages</a></li> <li><a class="icn_add_pages" href="#">Add Pages</a></li> <li><a class="icn_edit_pages" href="#">Edit Pages</a></li> <li><a class="icn_delete_pages" href="#">Delete Pages</a></li> </ul> <!-- End Content Nav --> <!-- Start Comments Nav --> <span class="ul-header"><a id="toggle-commentsnav" href="#" class="toggle visible">Comments</a></span> <ul id="commentsnav"> <li><a class="icn_manage_comments" href="#">Manage Comments</a></li> <li><a class="icn_add_comments" href="#">Add Comments</a></li> <li><a class="icn_edit_comments" href="#">Edit Comments</a></li> <li><a class="icn_delete_comments" href="#">Delete Comments</a></li> </ul> here is the css used .toggle { display:block; } .ul-header a.visible { background:url('../img/icons/small/toggle_close.png') no-repeat scroll 97% 50%; } .ul-header a.hidden { background:url('../img/icons/small/toggle_open.png') no-repeat scroll 97% 50%; } Please help.

    Read the article

  • Random <hr/> that I don't know how to get rid of!

    - by Anonymous the Great
    There is no extra <hr/> on the page, and I cannot figure out why it is there. Do you see anything that is causing it? I am sorry for posting the whole thing, I do not know exactly where it starts. The <hr/> is at the top somewhere, but I'm not sure where. <?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <font face="Segoe UI"> <body> <script type="text/javascript"> /*function detectBrowser() { var browser = navigator.appCodeName; if (browser!="Mozilla") {document.location.href="noaccess.php"; alert(browser);} } detectBrowser(); */ </script> <title>Second</title> <link rel="stylesheet" type="text/css" href="allCSS.css"/> <center> <!--<img align="right" src="logo.png" id="headerimg"/>--> <input type="image" id="headerimg" src="logo.png" align="right" onclick="toggleh();"/> <ul align="center" class=""> <div class="menu"> <ul class="nav"> <li><strong><a href="index.php">Home</a></strong> <ul> <li><a href="games.php">Games</a></li> <li><a href="browse.php">Browse</a></li> <li><a href="catalogue.php">Catalogue</a></li> <li><a href="forum.php">Forums</a></li> </ul> </li> <li><strong><a href="games">Games</a></strong> <ul> <li><a href="profile.php">Profile</a></li> <li><a href="settings.php">Settings</a></li> </ul> </li> <li><strong><a href="contact">Contact</a></strong> <ul> <li><a href="contact/index.php">Phone</a></li> <li><a href="contact/index.php">Email</a></li> <li><a href="contact/index.php">Mail</a></li> </ul> </li> </div> </center> </body> <center> <?php echo '<div id="msg">'; include 'message.txt'; echo '</div>'; //include 'hits.txt'; ?> <p> <?php function ChangeText($txt) { $txt='<script type="text/javascript">get();</script>'; echo '<script type="text/javascript">change();</script>'; $filename="message.txt"; $fp=fopen($filename,'w'); fwrite($fp,'<h4 class="hmsg">' . $txt . '</h4>'); fclose($fp); } ?> <script type="text/javascript"> <!-- window.onload=enter; function enter() { //alert("Welcome!"); //hideCMD(); } function get(text) { text=document.getElementById("ta").value; return text; } function toggleh() { var element=document.getElementById("headerimg"); if (element.style.display!="none"){element.style.display="none";} else {element.style.display="";} } function change(text) { text=document.getElementById("ta").value; if (text=="toggle") {toggleh(); return;} if (text=="home") {document.location.href="index.html"; return;} if (text.match("goto:*")) {var loc=text.substring(5,text.length); document.location.href=loc; return;} if (text.match("ban:*")) {var loc=text.substring(4,text.length); document.location.href=loc; return;} document.getElementById("msg").innerHTML='<h2 class="hmsg">'+text+'</h2>'; } function hideCMD() { document.getElementById("cmd").style.display="none"; } //--> </script> </head> <body> <div id="msg"> </div> <p id="cmd"> <hr class="cmdbar"></hr> <input class="panela" type="text" value="" id="ta" maxLength="20"/> <input class="panelb" type="image" src="submit.png" alt="Submit" onclick='change();'/> </p> </center> <p class="hide">HELLO!</p> </font> </html>

    Read the article

  • Automatically change div on mouseover and on timer

    - by IrishSaffa
    I'm a bit o a noob so any help would be great... What I need to do is have it so that the div associated to a specific li can change on hover as well as automatically change on a timer so that it scrolls through the option. here is my code: <script type="text/javascript"> $(function () { $("#switches li").mouseover(function () { var $this = $(this); $("#slides div").hide(); $("#slide" + $this.attr("id").replace(/switch/, "")).show(); }); }); </script> <div id="featured"> <ul id="switches"> <li id="switch1"><a href="activity_spa.html">Spa &amp; Wellness</a></li> <li id="switch2"><a href="#">Gala Venues</a></li> <li id="switch3"><a href="#">Dining</a></li> <li id="switch4"><a href="#">Shopping</a></li> <li id="switch5"><a href="#">Golf</a></li> <li id="switch6"><a href="#">Team Building</a></li> <li id="switch7"><a href="#">Equestrian</a></li> </ul> <div id="slides"> <div id="slide1"><img src="images/image2.jpg" alt="" /></div> <div id="slide2" style="display:none;"><img src="images/image6.jpg" alt="" /></div> <div id="slide3" style="display:none;"><img src="images/image1.jpg" alt="" /></div> <div id="slide4" style="display:none;"><img src="images/image3.jpg" alt="" /></div> <div id="slide5" style="display:none;"><img src="images/image5.jpg" alt="" /></div> <div id="slide6" style="display:none;"><img src="images/image7.jpg" alt="" /></div> <div id="slide7" style="display:none;"><img src="images/image4.jpg" alt="" /></div> </div> </div>

    Read the article

  • How to centre list-items in a column

    - by unknowndomain
    Hey all, I am trying to centre page numbers at the bottom of this test blog... http://jocelynwarner.com/test/ in the centre between the previous and next buttons however I cannot think how to do it, I tried a few different tutorials but they didn't really seem to help with this. Any hints on how to make them sit centrally in the left column (the width of the blog content - sidebar) would be greatly appreciated.

    Read the article

  • Stop event bubbling in Javascript

    - by Kartik Rao
    I have a html structure like : <div onmouseover="enable_dropdown(1);" onmouseout="disable_dropdown(1);"> My Groups <a href="#">(view all)</a> <ul> <li><strong>Group Name 1</strong></li> <li><strong>Longer Group Name 2</strong></li> <li><strong>Longer Group Name 3</strong></li> </ul> <hr /> Featured Groups <a href="#">(view all)</a> <ul> <li><strong>Group Name 1</strong></li> <li><strong>Longer Group Name 2</strong></li> <li><strong>Longer Group Name 3</strong></li> </ul> </div> I want the onmouseout event to be triggered only from the main div, not the 'a' or 'ul' or 'li' tags within the div! My onmouseout function is as follows : function disable_dropdown(d) { document.getElementById(d).style.visibility = "hidden"; } Can someone please tell me how I can stop the event from bubbling up? I tried the solutions (stopPropogation etc) provided on other sites, but I'm not sure how to implement them in this context. Any help will be appreciated. Thanks a lot!

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >