Search Results

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

Page 52/119 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • Backbone.Marionette - Collection within CompositeView, which itself is nested in a CollectionView

    - by nicefinly
    *UPDATE: The problem probably involves the tour-template as I've discovered that it thinks the 'name' attribute is undefined. This leads me to think that it's not an array being passed on to the ToursView, but for some reason a string. * After studying similar questions on StackOverflow: How to handle nested CompositeView using Backbone.Marionette? How do you properly display a Backbone marionette collection view based on a model javascript array property? Nested collections with Backbone.Marionette ... and Derick Bailey's excellent blog's on this subject: http://lostechies.com/derickbailey/2012/04/05/composite-views-tree-structures-tables-and-more/ ... including the JSFiddle's: http://jsfiddle.net/derickbailey/AdWjU/ I'm still having trouble with a displaying the last node of a nested CollectionView of CompositeViews. It is the final CollectionView within each CompositeView that is causing the problem. CollectionView { CompositeView{ CollectionView {} //**<-- This is the troublemaker!** } } NOTE: I have already made a point of creating a valid Backbone.Collection given that the collection passed on to the final, child CollectionView is just a simple array. Data returned from the api to ToursList: [ { "id": "1", "name": "Venice", "theTours": "[ {'name': u'test venice'}, {'name': u'test venice 2'} ]" }, { "id": "2", "name": "Rome", "theTours": "[ {'name': u'Test rome'} ]" }, { "id": "3", "name": "Dublin", "theTours": "[ {'name': u'test dublin'}, {'name': u'test dublin 2'} ]" } ] I'm trying to nest these in a dropdown where the nav header is the 'name' (i.e. Dublin), and the subsequent li 's are the individual tour names (i.e. 'test dublin', 'test dublin2', etc.) Tour Models and Collections ToursByLoc = TastypieModel.extend({}); ToursList = TastypieCollection.extend({ model: ToursByLoc, url:'/api/v1/location/', }); Tour Views ToursView = Backbone.Marionette.ItemView.extend({ template: '#tour-template', tagName: 'li', }); ToursByLocView = Backbone.Marionette.CompositeView.extend({ template: '#toursByLoc-template', itemView: ToursView, initialize: function(){ //As per Derick Bailey's comments regarding the need to pass on a //valid Backbone.Collection to the child CollectionView //REFERENCE: http://stackoverflow.com/questions/12163118/nested-collections-with-backbone-marionette var theTours = this.model.get('theTours'); this.collection = new Backbone.Collection(theTours); }, appendHtml: function(collectionView, itemView){ collectionView.$('div').append(itemView.el); } }); ToursListView = Backbone.Marionette.CollectionView.extend({ itemView: ToursByLocView, }); Templates <script id="tour-template" type="text/template"> <%= name %> </script> <script id="toursByLoc-template" type="text/template"> <li class="nav-header"><%= name %></li> <div class="indTours"></div> <li class="divider"></li> </script>

    Read the article

  • jQuery lava-lamp-like effect bouncing all over the place!

    - by Nathan Loding
    I followed the tutorial found here and added my own flare to it: tutorial What I was looking to accomplish was to put a specific image on the left and right side of the list item. So instead of just the generic <li id="blob"></li> created in the tutorial, I did <li id="blob"><div class="blob-wrap"><div class="leftimage"></div><div class="rightimage"></div></li> to accomplish the particular effect I wanted. It works beautifully ... except that the image attempts to bounce back the "currentPageItem" if I leave the mouse hovering over one of the list items. Here's a JS Bin example: http://jsbin.com/odome What do I need to do to fix it? jQuery is firing the "hoverOut" function (or whatever you want to call it). But why?

    Read the article

  • Dropdown menu disappears in IE7

    - by Justine
    A weird problem with a dropdown menu in IE7: http://screenr.com/SNM The dropdown disappears when the mouse moves to a part that hovers above other layers. The HTML structure looks like this: <div class="header"> <ul class="nav> <li><a href="">item</a> <ul><li><a href="">sub-item</a></li></ul> </li> </ul> </div><!-- /header--> <div class="featured"></div> <div class="content"></div> The sub-menu is positioned absolutely and has visibility:hidden, then it's set to visible using jQuery, like so: $(".header ul.nav li").hover(function(){ $(this).addClass("hover"); $('ul:first',this).css('visibility', 'visible'); }, function(){ $(this).removeClass("hover"); $('ul:first',this).css('visibility', 'hidden'); }); I had a problem with the dropdown hiding under other content in IE7, fixed easily by giving the z-index to its parent and other divs: *:first-child+html .header { position: relative; z-index: 2 !important; } *:first-child+html .content, *:first-child+html .main, *:first-child+html .primary *:first-child+html .featured { position: relative; z-index: 1 !important; } Now, I have no idea why the menu disappears when hovered over other divs, you can view the site live here: http://dev.gentlecode.net/ama/ubezpieczenia.html I would love any help, been staring at this code for ages now without any solution. I guess it's just me tunnel visioning already... Thanks in advance for any help!

    Read the article

  • Cufon h2 on div hover

    - by SoulieBaby
    Hi all, I have h2 tags inside divs which I need to change colour on div hover, if the cufon is turned off, the h2 tag changes colour fine, but when cufon is turned on, it doesn't change colour. Here's my code: Cufon Cufon.set('fontFamily', 'DIN'); Cufon.replace('.listing_04 li a .bx1 .right .head_bx h2', { hover: true, hoverables: { a: true, div: true } }); CSS .listing_04 li a .bx1 .right .head_bx h2 { color: #e91397; font-size: 16px; padding: 0px; margin: 0px; } .listing_04 li a:hover .bx1 .right .head_bx h2 { color: #ffff00; } Code <div class="listing_04"> <ul> <li> <a href="#"> <div class="bx1"> <div class="left"> <img src="images/friends_only.jpg" alt="" border="0" class="img_border01" /> <div class="staring_bx"> <img src="images/star1.png" border="0" /> <img src="images/star1.png" border="0" /> <img src="images/star1.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /></div> </div> <div class="right"> <div class="head_bx"> <h2><strong>The Party Girls</strong></h2> My Favourites</div> <p> By : <b>Modi</b><br /> 19 Jan 2010 @ 20:20<br /> Views : <strong>1542484</strong><br /> Comments : <strong>84 </strong></p> </div> <div class="clear"></div> </div> </a> </li> <li> <a href="#"> <div class="bx1"> <div class="left"> <img src="images/img_07.jpg" alt="" border="0" class="img_border01" /> <div class="staring_bx"> <img src="images/star1.png" border="0" /> <img src="images/star1.png" border="0" /> <img src="images/star1.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /></div> </div> <div class="right"> <div class="head_bx"> <h2><strong>The Party Girls</strong></h2> My Favourites</div> <p> By : <b>Modi</b><br /> 19 Jan 2010 @ 20:20<br /> Views : <strong>1542484</strong><br /> Comments : <strong>84 </strong></p> </div> <div class="clear"></div> </div> </a> </li> <li> <a href="#"> <div class="bx1"> <div class="left"> <img src="images/resticted_image.jpg" alt="" border="0" class="img_border01" /> <div class="staring_bx"> <img src="images/star1.png" border="0" /> <img src="images/star1.png" border="0" /> <img src="images/star1.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /> <img src="images/star2.png" width="16" height="15" border="0" /></div> </div> <div class="right"> <div class="head_bx"> <h2><strong>The Party Girls</strong></h2> My Favourites</div> <p> By : <b>Modi</b><br /> 19 Jan 2010 @ 20:20<br /> Views : <strong>1542484</strong><br /> Comments : <strong>84 </strong></p> </div> <div class="clear"></div> </div> </a> </li> </ul> <div class="clear"></div> </div> Example URL: http://dev.splished.360southclients.com/test.php In this test I've disabled cufon for you to see that the h2 colour change works when you hover over the .bx1 div, click "turn cufon on" to see it with the cufon.

    Read the article

  • Can you handle both json and html datatypes in the same ajax call?

    - by Prabhu
    Is there anyway I can handle both json and html return types when posting jquery ajax: For example, this ajax call expects html back $.ajax({ type: "POST", url: url data: data, dataType: "html", success: function (response) { var $html = "<li class='list-item'>" + response + "</li>"; $('#a').prepend($html); }, error: function (xhr, status, error) { alert(xhr.statusText); } }); but I wanted to modify it so that I can return a json object if there is a model error. so I can do something like this: success: function (response) { if (response.Error){ alert(response.Message); } else { var $html = "<li class='list-item'>" + response + "</li>"; $('#a').prepend($html); } Is this possible?

    Read the article

  • PHP & MySQL - Deleting table rows problem.

    - by oReiLLy
    Okay my script is supposed to delete a specific users case which is stored in 2 MySQL tables but for some reason when the user deletes the specific case it deletes all the users cases I only want it to delete the case the user selects. I was wondering how can I fix this problem? Thanks in advance for helping. Here is the PHP & MySQL code. if(isset($_POST['delete_case'])) { $cases_ids = array(); $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"SELECT cases.*, users_cases.* FROM cases INNER JOIN users_cases ON users_cases.cases_id = cases.id WHERE users_cases.user_id='$user_id'"); if (!$dbc) { print mysqli_error($mysqli); } else { while($row = mysqli_fetch_array($dbc)){ $cases_ids[] = $row["cases_id"]; } } foreach($_POST['delete_id'] as $di) { if(in_array($di, $cases_ids)) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"DELETE FROM users_cases WHERE cases_id = '$di'"); $dbc2 = mysqli_query($mysqli,"DELETE FROM cases WHERE id = '$di'"); } } } Here is the XHTML code. <li> <input type="text" name="file[]" size="25" /> <input type="text" name="case[]" size="25" /> <input type="text" name="name[]" size="25" /> <input type="submit" name="delete_case" id="delete_case" value="Delete Case" /> <input type="hidden" name="delete_id[]" value="' . $row['cases_id'] . '" /> </li> <li> <input type="text" name="file[]" size="25" /> <input type="text" name="case[]" size="25" /> <input type="text" name="name[]" size="25" /> <input type="submit" name="delete_case" id="delete_case" value="Delete Case" /> <input type="hidden" name="delete_id[]" value="' . $row['cases_id'] . '" /> </li> <li> <input type="text" name="file[]" size="25" /> <input type="text" name="case[]" size="25" /> <input type="text" name="name[]" size="25" /> <input type="submit" name="delete_case" id="delete_case" value="Delete Case" /> <input type="hidden" name="delete_id[]" value="' . $row['cases_id'] . '" /> </li> Here is the MySQL tables. CREATE TABLE cases ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, file VARCHAR(255) NOT NULL, case VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE users_cases ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, cases_id INT UNSIGNED NOT NULL, user_id INT UNSIGNED NOT NULL, PRIMARY KEY (id) );

    Read the article

  • ForEach loop: Output something different on every second result

    - by Wade D Ouellet
    I have two for each loops and I am trying to output something different for each second result: foreach ($wppost as $wp) { $wp_title = $wp->post_title; $wp_date = strtotime($wp->post_date); $wp_slug = $wp->post_name; $wp_id = $wp->ID; // Start Permalink Template $wp_showurl = $wp_url; $wp_showurl = str_replace("%year%", date('Y', $wp_date), $wp_showurl); $wp_showurl = str_replace("%monthnum%", date('m', $wp_date), $wp_showurl); $wp_showurl = str_replace("%day%", date('d', $wp_date), $wp_showurl); $wp_showurl = str_replace("%hour%", date('H', $wp_date), $wp_showurl); $wp_showurl = str_replace("%minute%", date('i', $wp_date), $wp_showurl); $wp_showurl = str_replace("%second%", date('s', $wp_date), $wp_showurl); $wp_showurl = str_replace("%postname%", $wp_slug, $wp_showurl); $wp_showurl = str_replace("%post_id%", $wp_id, $wp_showurl); // Stop Permalink Template $wp_posturl = $blog_address . $wp_showurl; echo '<li><a href="'.$wp_posturl.'" title="'.$wp_title.'">'.$wp_title.'</a></li>'; } For this one I want it to echo li class="even" instead of just li for each second result. I think this will have to be changed to a for loop to accomplished this but I am not sure how that is done without breaking it. Exact same for this one: if(is_array($commenters)) { foreach ($commenters as $k) { ?><li><?php if($ns_options["make_links"] == 1) { $url = ns_get_user_url($k->poster_id); if(trim($url) != '') { echo "<a href='" . $url . "'>"; } } if($ns_options["make_links"] == 2) { $url = ns_get_user_profile($k->poster_id); echo "<a href='" . $url . "'>"; } $name = $bbdb->get_var(" SELECT user_login FROM $bbdb->users WHERE ID = $k->poster_id"); echo ns_substr_ellipse($name, $ns_options["name_limit"]); if(trim($url) != '' && $ns_options["make_links"] == 1) { echo "</a>"; } if($ns_options["make_links"] == 2) { echo "</a>"; } if ($ns_options["show_posts"] == 1) { echo " (" . $k->num_posts . ")\n"; } echo $ns_options["end_html"] . "\n"; unset($url); } } else { ?></li><?php } Thanks, Wade

    Read the article

  • jQuery SlideUp...But dont disappear off screen

    - by danit
    Is it possible to use .slideUp, but the object only slideUp by (For instance) by 20px instead of disappearing off screen? HTML: <div class="toolbar"> <p>Hide</p> <ul> <li>Tab 1</li> <li>Tab 2</li> </ul> </div> JQUERY: $(".toolbar p").click(function() { $(".toolbar").slideUp(); });

    Read the article

  • jquery attr problem

    - by shanmugam
    function rotateimg(ulid,showid,linkid) { var cur = $("#"+ulid+" li.current"); var nxt = cur.next("li"); if (nxt.length == 0) { nxt = $("#"+ulid+" li:first"); } cur.removeClass("current"); nxt.addClass("current"); var img_value=nxt.attr("id").substring(11); var img_title=nxt.attr("title"); var img_id = nxt.attr("name").substring(17); var alink=nxt.attr("rel"); $("#"+linkid).attr("href",alink); $("#"+ulid+" li div").css("background-color", "#000000"); nxt.find("div").css("background-color", "#333333"); setimg(img_value,showid,img_title); } var lt=setInterval("rotateimg('lnews','show_images_event','lnewslink')", 5000); in this code. i am getting this error nxt.attr("id") is undefined pls any one help me

    Read the article

  • Why should I prepend my custom attributes with "data-"?

    - by Horace Loeb
    So any custom data attribute that I use should start with "data-": <li class="user" data-name="John Resig" data-city="Boston" data-lang="js" data-food="Bacon"> <b>John says:</b> <span>Hello, how are you?</span> </li> Will anything bad happen if I just ignore this? I.e.: <li class="user" name="John Resig" city="Boston" lang="js" food="Bacon"> <b>John says:</b> <span>Hello, how are you?</span> </li> I guess one bad thing is that my custom attributes could conflict with HTML attributes with special meanings (e.g., name), but aside from this, is there a problem with just writing "example_text" instead of "data-example_text"? (It won't validate, but who cares?)

    Read the article

  • PHP & MySQL fckeditor integration?

    - by TaG
    I just downloaded fckeditor and dropped the folder into my root directory but I don't know how to install the fckeditor into my forms for example, I wanted to integrate the fckeditor into the About Me and My Interests form fields in the form below, but I don't know how or even how to change the fckeditor skins. Can someone show me how to do this? I'm using PHP and MySQL Here is the html. <form method="post" action="index.php"> <fieldset> <ul> <li><label for="about-me">About Me: </label> <textarea rows="8" cols="60" name="about-me" id="about-me"></textarea></li> <li><label for="my-interests">My Interests: </label> <textarea rows="8" cols="60" name="interests" id="interests"></textarea></li> <li><input type="submit" name="submit" value="Save Changes" class="save-button" /> </ul> </fieldset> </form>

    Read the article

  • CSS Menu disappear

    - by WtFudgE
    Hi, I created a menu in html/css but where I wanted the subitems to be shown on parent item hover. The problem is when I hover on it in IE it only shows it's subitems when I hover on the text in the menu item, If I hover over the element and not the text the subitems disappear again. So if I hover and want to move my mouse to my submenu the submenu disappears unless I'm fast enough. This is very annoying, does anyone know how I can solve this? MY menu code is like so: <ul id="leftnav"> Item1 SubItem1 SubItem2 SubItem3 Item2 SubItem1 SubItem2 SubItem3 The menu should be a left sided menu which shows it's subitems only on hover, so I used css to achieve this with the following code: #leftnav, #leftnav ul { padding: 0; margin: 0; } #leftnav ul li { margin-left: 102px; position: relative; top: -19px; /*sets the childitems on the same height as the parent item*/ } #leftnav li { float: left; width: 100px; } #leftnav ul { position: absolute; width: 100px; left: -1000px; /*makes it disappear*/ } #leftnav li:hover ul, #leftnav li.ie_does_hover ul { left: auto; } #leftnav a { display: block; height: 15px; margin-top: 2px; margin-bottom: 2px; } Since this only works with firefox I also had to insert a javascript to get this to work in IE using code: <script language="JavaScript"> sfHover = function() { var sfElsE = document.getElementById("leftnav").getElementsByTagName("LI"); for (var i=0; i<sfElsE.length; i++) { sfElsE[i].onmouseover=function() { this.className+=" ie_does_hover"; } sfElsE[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" ie_does_hover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); </script> Many many many thanks for replies

    Read the article

  • bbPress Loop help

    - by Cameron
    Hi I have the following code: <?php if ( bb_forums() ) : ?> <?php while ( bb_forum() ) : ?> <div class="box"> <?php if (bb_get_forum_is_category()) : ?> <h3><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a></h3> <?php continue; endif; ?> <ol> <li class="arrow f_unread"> <a href="<?php forum_link(); ?>"> <strong><?php forum_name(); ?></strong><br /> <?php forum_topics(); ?> Topics / <?php forum_posts(); ?> Replies </a> </li> </ol> </div> <?php endwhile; ?> <?php endif; // bb_forums() ?> Struggling to get it to work how I want which is basically like this: for each category do this: <div class="box"> <h3>CAT</h3> <ol> <li>Forum</li> <li>Forum</li> </ol> </div> so that div should be repeated for each block. if a set of forums has not category, then all of the code would be above would run but just no h3. can anyone help thanks.

    Read the article

  • jQuery - IF then Remove class on .hover

    - by danit
    I have the following jQuery function: $(function(){ if ($(".menu li").hasClass("active")) { $(".active").css("margin-top", "6px"); } }); This is applied to a CSS/jQuery menu, which expands and contracts when each menu item is hovered over. The onClick event adds a margin-top of 6px to give the impressions of a button depress. I'm then using PHP to detect which page the user is visiting to add an .active class to the relevant menu item. The question, the .active class should remain in place until the user hovers over a different menu item. At which point the .active class should be removed from this element - As the .active class is reused on the .hover events. Here is the basic HTML Markup: <ul id="menu"> <li> <div class="inner"> <div class="button"><img src="images/insightbutton.png" /></div> <div class="description">&nbsp;</div> </div> </li> <li> <div class="inner"> <div class="button"><img src="images/insightbutton.png" /></div> <div class="description">&nbsp;</div> </div> </li> </ul> How can I keep the .active class applied to the active menu item, but remove it when .inner is hovered over?

    Read the article

  • jquery ui tabs redirecting to ASPX page on postbacks

    - by neoneo007
    I am being redirected to the actual aspx page when I submit the form. How to avoid the redirection. Tabs.aspx <div id="container-1"> <ul> <li><a href="Survey.aspx?group=1"><span>HR</span></a></li> <li><a href="Survey.aspx?group=2"><span>Sales</span></a></li> <li><a href="Survey.aspx?group=3"><span>Finance</span></a></li> </ul> jquery code in tabs.aspx <script type="text/javascript"> $(function() { $('#container-1 > ul').tabs(); </script> Survey.aspx <form id="form1" runat="server"> <div> <asp:Label ID="lblHeading" runat="server"></asp:Label><br /> <asp:HiddenField ID="hdnGroupId" runat="server" /> <br /> 1) Question 1 <asp:DropDownList ID="DropDownList1" runat="server"> </asp:DropDownList>     <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /> 2) Another question:  <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br /> <br /> <br /> <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" /><br /> <div id="Result">Click here for the time.</div> <asp:Label ID="lblMessage" runat="server"></asp:Label></div> </form> Survey page Code behind protected void btnSave_Click(object sender, EventArgs e) { if (groupId > 0) { switch (groupId) { case 1: lblMessage.Text = "HR data is saved."; break; case 2: lblMessage.Text = "Sales data is saved."; break; case 3: lblMessage.Text = "Finance data is saved."; break; default: break; } } }

    Read the article

  • What is prefered method to set consistence font-size and line height for website using em?

    - by metal-gear-solid
    What is the best method to set cross-browser consistence typography (font-size and line height) for whole site using em for Fixed width {Width:970px}, centered website? I usually get design from client with multiple font size and line heights at various places in design. for some good reason i still use em without getting nested element problem and font-size inconsistencies in IE and others. then after setting how to manage and update easily ,and how to calculate ems I want to set easily manageable font sizes and I want to set Line height manually (because it can be different for various places in design. And for which things we should define line-height or for which not? How to set font-size and line-height to get consistent result. and if i'm using em for font-sizing then should i also use bottom-margin of h1, p, li etc in em? HTML {} BODY {} P {} a {} ul li a {} ul li ul li a {} p img {float:left} td,th { }

    Read the article

  • sIFR - getting a:hover to work in navigation list

    - by HudRom
    Hi, I am currently struggling with sIFR and a:hover. My problem site is hosted at http://irene.huditsch.info I have the following HTML code: <body id="irene-huditsch-info"> <div id="header"> <h1>Irene Huditsch</h1> <div id="top-nav"> <ul> <li id="impressum"> <a href="impressum.html" rel="index">Impressum</a> </li> <li id="kontakt"> <a href="kontakt.html">Kontakt</a> </li> </ul> </div> ... My sIFR-config.js looks like: sIFR.replace(braganza, { selector: 'div#top-nav a', css: '.sIFR-root { background-color: transparent; color: #FFFFFF; line-height: 13px; font-size: 11px; text-decoration: underline; cursor: pointer; } .sIFR-root:hover { color: #592b02; }', wmode: 'transparent' }); But the hover doesn't take effect. I tried different solution with no success either. When I write sIFR.replace(braganza, { selector: 'div#top-nav li', css: 'a { background-color: transparent; color: #FFFFFF; line-height: 13px; font-size: 11px; text-decoration: underline; cursor: pointer; } a:hover { color: #592b02; }', wmode: 'transparent' }); (which seems logical to me), the list items are not rendered at all. Could you please give me an advice how to do it correctly with the structure given? Thanks, Roman

    Read the article

  • Help with jQuery Traversal

    - by Jack Webb-Heller
    Hi guys, I'm struggling a bit with traversing in jQuery. Here's the relevant markup: <ul id="sortable" class="ui-sortable"> <li> <img src="http://ecx.images-amazon.com/images/I/51Vza76tCxL._SL160_.jpg"> <div class="controls"> <span class="move">?</span> <span class="delete">?</span> </div> <div class="data"> <h1>War and Peace (Oxford World's Classics)</h1> <textarea>Published to coincide with the centenary of Tolstoy's death, here is an exciting new edition of one of the great literary works of world literature.</textarea> </div> </li> <li> <img src="http://ecx.images-amazon.com/images/I/51boZxm2seL._SL160_.jpg"> <div class="controls"> <span class="move">?</span> <span class="delete">?</span> </div> <div class="data"> <h1>A Christmas Carol and Other Christmas Writings (Penguin Classics)</h1> <span>Optionally, write your own description in the box below.</span> <textarea>Dicken's Christmas writings-in a new, sumptuous, and delightful clothbound edition.</textarea> </div> </li> </ul> This is code for a jQuery UI 'Sortable' element. Here's what I want to happen. When the Delete thing is clicked ($('.delete')), I want the <li> item it's contained within to be removed. I've tried using $('.delete').parent().parent().remove(); but in the case of having two items, that seems to delete both of them. I'm a bit confused by this. I also tried using closest() to find the closest li, but that didn't seem to work either. How should I best traverse the DOM in this case? Thanks! Jack

    Read the article

  • slideDown Doesn't work for me.

    - by Lucifer
    Hi All, Why doesn't this jQuery code work? $(document).ready(function () { $('currentPage').click(function() { $('myaccount').slideDown('slow', function() { // Animation complete. }); }); }); <li><a class="currentPage">Home</a></li> <li><a class="myaccount">My Account</a></li> Anyone got any ideas? I don't.

    Read the article

  • jquery: why a selector returns me an array, but attribute doesnt?

    - by Shlomi.A.
    Hi. I'm trying to understand JQ better. I'm calling an JQ object $(".FamiliesList li li span[class!='']").prev().find('option:selected') this returns back to me an array of all the options that their span parent's brother has a classname. [option, option] Now- I want to return back an array of the option's values $(".FamiliesList li li span[class!='']").prev().find('option:selected').attr('value') this returns back to me only the first child value, and a full array of the values. Why? I would appreciate to receive help and understand jq better :) Thanks.

    Read the article

  • JqTouch - Detect trigger for animation

    - by majman
    Yet another problem I'm having w/ jqTouch... I'm trying to detect what element was clicked to trigger an animation so that I can pass parameters from the clicked item to the subsequent page. My HTML is: <div id="places"> <div class="toolbar"> <h1>Places</h1> <a class="back" href="#">Back</a> </div> <ul> <li id="1"><a href="#singleplace">Place 1</a></li> <li id="2"><a href="#singleplace">Place 2</a></li> <li id="3"><a href="#singleplace">Place 3</a></li> </ul> </div> <div id="singleplace"> <div class="toolbar"> <h1></h1> <a class="back" href="#">Back</a> </div> </div> When I click on any of the list items in #places, I'm able to slide over to #singleplace just fine, but I'm trying to detect which element was clicked so that I can pass parameters into the #singleplace div. My javascript is: var placeID; $('#places a').live('mouseup',function(){ $('#singleplace h1').html($(this).text()) placeID = $(this).parent().attr('id'); }) I've tried several alternatives to the $(el).live('event', fn()) approach including: $('#places a').live('click',fn()... $('#places a').live('mouseup',fn()... $('#places a').live('tap',fn()... $('#places a').tap(fn()... None of which seem to work. Is there a better way I could be handling this? I noticed on jqTouch's issues page, there is this: http://code.google.com/p/jqtouch/issues/detail?id=91 which may be part of the problem...

    Read the article

  • PHP and MySQL problem?

    - by TaG
    When my code is stored and saved and out putted I keep getting these slashes \\\\\ in my output text. how can I get rid of these slashes? Here is the PHP code. if (isset($_POST['submitted'])) { // Handle the form. require_once '../../htmlpurifier/library/HTMLPurifier.auto.php'; $config = HTMLPurifier_Config::createDefault(); $config->set('Core.Encoding', 'UTF-8'); // replace with your encoding $config->set('HTML.Doctype', 'XHTML 1.0 Strict'); // replace with your doctype $purifier = new HTMLPurifier($config); $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"SELECT users.*, profile.* FROM users INNER JOIN contact_info ON contact_info.user_id = users.user_id WHERE users.user_id=3"); $about_me = mysqli_real_escape_string($mysqli, $purifier->purify($_POST['about_me'])); $interests = mysqli_real_escape_string($mysqli, $purifier->purify($_POST['interests'])); if (mysqli_num_rows($dbc) == 0) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"INSERT INTO profile (user_id, about_me, interests) VALUES ('$user_id', '$about_me', '$interests')"); } if ($dbc == TRUE) { $dbc = mysqli_query($mysqli,"UPDATE profile SET about_me = '$about_me', interests = '$interests' WHERE user_id = '$user_id'"); echo '<p class="changes-saved">Your changes have been saved!</p>'; } if (!$dbc) { // There was an error...do something about it here... print mysqli_error($mysqli); return; } } Here is the XHTML code. <form method="post" action="index.php"> <fieldset> <ul> <li><label for="about_me">About Me: </label> <textarea rows="8" cols="60" name="about_me" id="about_me"><?php if (isset($_POST['about_me'])) { echo mysqli_real_escape_string($mysqli, $_POST['about_me']); } else if(!empty($about_me)) { echo mysqli_real_escape_string($mysqli, $about_me); } ?></textarea></li> <li><label for="my-interests">My Interests: </label> <textarea rows="8" cols="60" name="interests" id="interests"><?php if (isset($_POST['interests'])) { echo mysqli_real_escape_string($mysqli, $_POST['interests']); } else if(!empty($interests)) { echo mysqli_real_escape_string($mysqli, $interests); } ?></textarea></li> <li><input type="submit" name="submit" value="Save Changes" class="save-button" /> <input type="hidden" name="submitted" value="true" /> <input type="submit" name="submit" value="Preview Changes" class="preview-changes-button" /></li> </ul> </fieldset> </form>

    Read the article

  • JQuery Coding Question?

    - by SLAPme
    I'm kind of new to JQuery i really don't know how to code in the .hide() so that it hides the following code from begin displayed until clicked <li>Changes saved!</li> and then have it fade in using the .fadeIn. Can some one show me how to code in the .hide() and .fadeIn correctly into my JQuery code? Here is the JQuery code. $(function() { $(".save-button").click(function() { $.post($("#contact-form").attr("action"), $("#contact-form").serialize(), function(html) { $("div.contact-info-form").html(html); $('#changes-saved').append('<li>Changes saved!</li>'); }); return false; // prevent normal submit }); });

    Read the article

  • strange problem with WriteBeginTag

    - by user276640
    i use such code, but it renders with error <li class="dd0"><div id="dt1"<a href="http://localhost:1675/Category/29-books.aspx">Books</a></div></li> there is no > in opening tag div. what the problem? writer.WriteBeginTag("li"); //writer.WriteAttribute("class", this.CssClass); writer.WriteAttribute("class", "dd0"); if (!String.IsNullOrEmpty(this.LiLeftMargin)) { writer.WriteAttribute("style", string.Format("margin-left: {0}px", this.LiLeftMargin)); } writer.Write(HtmlTextWriter.TagRightChar); writer.WriteBeginTag("div"); writer.WriteAttribute("id", "dt1"); this.HyperLink.RenderControl(writer); writer.WriteEndTag("div"); writer.WriteEndTag("li");

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >