Search Results

Search found 169 results on 7 pages for 'slideup'.

Page 6/7 | < Previous Page | 2 3 4 5 6 7  | Next Page >

  • simplemodal - IE8 $.support.boxModel is not NULL and no object

    - by tom007
    Hi, I try to use the simplmodal script from: http://www.ericmmartin.com/projects/simplemodal/ I got this error $.support.boxModel is not NULL.. in IE8. jquery.simplemodal-1.3.4.min.js?F This is my implementation scipt.. what I have to change to avoid this error? function loadIframe(url){ $.modal('<iframe src="' + url + '" height="700px" width="600px" scrolling="no">', { containerCss:{ backgroundColor:"#fff", borderColor:"#333", }, overlayClose:true, opacity:70, overlayCss: { backgroundColor:"#000" }, onOpen: function (dialog) { dialog.overlay.fadeIn('slow', function () { dialog.container.toggleClass("preloader"); dialog.data.hide(); dialog.container.fadeIn('slow', function () { dialog.container.toggleClass("preloader"); dialog.data.slideDown('slow'); }); }); }, onClose: function (dialog) { dialog.data.fadeOut('slow', function () { dialog.container.slideUp('slow', function () { dialog.overlay.fadeOut('slow', function () { $.modal.close(); // must call this! }); }); }); } }); } $(document).ready(function(){ $("img").click(function(){ var baseurl = location.host; var url = $(this).attr("target"); var url = 'http://' + baseurl + url; loadIframe(url); }); });

    Read the article

  • Swapping content in a seperate div on hover

    - by Fuego DeBassi
    I feel like this should work: $(".module .one").hover(function() { $("#viewport #one").addClass('red'); }); Basically I am hiding all the .children of "#viewport on load, then when a seperate element is hovered, in this case .module .one I want to change something on the corresponding viewport ID #viewport #one. Basic idea is a variable content window, where when a thumbnail or whatever I put in the modules swaps the content shown in the viewport. Something I am doing wrong? Here is my full code: <script type="text/javascript"> $(document).ready(function() { $(".module .caption").hide(); $("#viewport").children().hide(); $(".module").hover(function() { $(this).find(".caption").slideDown().end().siblings('.module').addClass('under'); },function() { $(this).find(".caption").slideUp().end().siblings('.module').removeClass('under'); }); $(".module .one").hover(function() { $("#viewport #one").addClass('red'); }); }); </script> The bigger hover function in the middle is for some fancy rollover effects that the modules will perform themselves, but for these purposes I just want to figure out why I can't add a Class to a separate element when another is hovered. Would love some help/advice!

    Read the article

  • Codeigniter: Simple ajax submit not working

    - by Kevin Brown
    jQuery: $('#welcome-message').submit(function() { // inside event callbacks 'this' is the DOM element so we first // wrap it in a jQuery object and then invoke ajaxSubmit $(this).ajaxSubmit({}); $(this).fadeTo(400, 0, function () { // Links with the class "close" will close parent $(this).slideUp(400); }); return false; }); Controller: function welcome_message() { if(isset($_POST['welcome_message'])) { $this-_my_private_function(); } } private function _my_private_function() { $id = $this->session->userdata('id'); $profile['welcome_message'] = '0'; $this->db->update('be_user_profiles',$profile, array('user_id' => $id)); redirect('home', 'location'); } html: <?php print form_open('home/welcome_message',array('class'=>'horizontal','id'=>'welcome-message'))?> <p> Before you can complete the assessment, you need to complete your profile. Once that's done you'll be ready! After you have completed the assessment, you will be able to view the results from your profile. </p> <input type="checkbox" value="0" name="welcome_message" checked="false"> Don't show me this again </input> <p> <input class="button submit" type="submit" class="close-box" value="Close" /> </p> <?php print form_close()?> This should be working. My hypothesis is that the data isn't being passed to the function...but I really have no idea! It works when I visit the function in the url.

    Read the article

  • Make accordeon/toggle menu using jquery or javascript

    - by Souza
    Found a solution: $('div.divname').not(':eq(0)').hide(); Check this page: http://www.iloja.pt/index.php?_a=viewDoc&docId=19 I would like to have ONLY the first text (faqtexto) open, and the one bellow, hidden on loading (by default) This is the HTML: <div class="agendarfaq"> <div class="topfaq"></div> <div class="faqtopics"><p class="textopics">Recolha e entrega, quanto tempo?</p></div> <div class="faqtexto"> Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem</div> <div class="faqtopics"><p class="textopics">Recolha e entrega, quanto tempo?</p></div> <div class="faqtexto"> Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem</div> </div> The jQuery I propose: $(".faqtopics").click(function(event) { $("div.faqtexto").slideUp(100); $(this).next("div.faqtexto").slideToggle(); }); Do you suggest any other cleaner jQuery code? Any help would be welcome! Thank you very much!

    Read the article

  • Is there a default way to get hold of an internal property in jQueryUi widget?

    - by prodigitalson
    Im using an existing widget from the jquery-ui labs call selectmenu. It has callback options for the events close and open. The problem is i need in these event to animate a node that is part of the widget but not what its connected to. In order to do this i need access to this node. for example if i were to actually modify the widget code itself: // ... other methods/properties "open" : function(event){ // ... the original logic // this is my animation $(this.list).slideUp('slow'); // this is the orginal call to _trigger this._trigger('open', event, $this._uiHash()); }, // ... other methods/properties However when in the scope of the event handler i attach this is the orginal element i called the widget on. I need the widget instance or specifically the widget instance's list property. $('select#custom').selectmenu({ 'open': function(){ // in this scope `this` is an HTMLSelectElement not the ui widget } }); Whats the best way to go about getting the list property from the widget?

    Read the article

  • Jquery grid overlay in wordpress

    - by Anders Kitson
    I am adding this simple plugin that I have working in a static html site, and am trying to add it to a wordpress development site based off of 960 gs. The jquery code links are correct but the console gives me this error "Uncaught TypeError: Cannot call method 'addGrid' of null" I got the code from this turtorial http://www.badlydrawntoy.com/2009/04/21/960gs-grid-overlay-a-jquery-plugin/ Here is the code I am using /*<![CDATA[*/ // onload $(function() { $("body").addGrid(12, {img_path: 'img/'}); }); /*]]>*/ Here is the code for the plugin /* * @ description: Plugin to display 960.gs gridlines See http://960.gs/ * @author: badlyDrawnToy sharp / http://www.badlydrawntoy.com * @license: Creative Commons License - ShareAlike http://creativecommons.org/licenses/by-sa/3.0/ * @version: 1.0 20th April 2009 */ (function($){$.fn.addGrid=function(cols,options){var defaults={default_cols:12,z_index:999,img_path:'/images/',opacity:.6};var opts=$.extend(defaults,options);var cols=cols!=null&&(cols===12||cols===16)?cols:12;var cols=cols===opts.default_cols?'12_col':'16_col';return this.each(function(){var $el=$(this);var height=$el.height();var wrapper=$('<div id="'+opts.grid_id+'"/>').appendTo($el).css({'display':'none','position':'absolute','top':0,'z-index':(opts.z_index-1),'height':height,'opacity':opts.opacity,'width':'100%'});$('<div/>').addClass('container_12').css({'margin':'0 auto','width':'960px','height':height,'background-image':'url('+opts.img_path+cols+'.png)','background-repeat':'repeat-y'}).appendTo(wrapper);$('<div>grid on</div>').appendTo($el).css({'position':'absolute','top':0,'left':0,'z-index':opts.z_index,'background':'#222','color':'#fff','padding':'3px 6px','width':'40px','text-align':'center'}).hover(function(){$(this).css("cursor","pointer");},function(){$(this).css("cursor","default");}).toggle(function(){$(this).text("grid off");$('#'+opts.grid_id).slideDown();},function(){$(this).text("grid on");$('#'+opts.grid_id).slideUp();});});};})(jQuery);

    Read the article

  • JQuery drag, drop and save via cookie - how to?

    - by RussP
    Sorry to be back folks, but you guys & girls seem to know much more about this than I do ... anyhow, here is my question/problem I want to use drag, drop, sort (the interface plugin does me even though I have read it's out of date? but have looked at UI and to be honest is not clear and to me appears heavier than interface?) Anyhow, how do I set a cookie to save positions from this: $(document).ready( function () { $('a.closeEl').bind('click', toggleContent); $('div.groupWrapper').Sortable( { accept: 'groupItem', helperclass: 'sortHelper', activeclass : 'sortableactive', hoverclass : 'sortablehover', handle: 'div.itemHeader', tolerance: 'pointer', onChange : function(ser) { }, onStart : function() { $.iAutoscroller.start(this, document.getElementsByTagName('body')); }, onStop : function() { $.iAutoscroller.stop(); } } ); } ); var toggleContent = function(e) { var targetContent = $('div.itemContent', this.parentNode.parentNode); if (targetContent.css('display') == 'none') { targetContent.slideDown(300); $(this).html('[-]'); } else { targetContent.slideUp(300); $(this).html('[+]'); } return false; }; var ser = function (s) { serial = $.SortSerialize(s); alert(serial.hash); }; which is the "standard" interface demo, PLUS How do I then get to read that cookie so that when I next visit the page the order is as I set it in the cookie? Hopefully from that I can work out the rest .......? Thanks for help in advance.

    Read the article

  • jQuery expanding menu

    - by Milen
    Hi everybody, i have this html code: <ul id="nav"> <li>Heading 1 <ul> <li>Sub page A</li> <li>Sub page B</li> <li>Sub page C</li> </ul> </li> <li>Heading 2 <ul> <li>Sub page D</li> <li>Sub page E</li> <li>Sub page F</li> </ul> </li> </ul> With this JS code: $(function(){ $('#nav>li>ul').hide(); $('#nav>li').mouseover(function(){ if ($('#nav ul:animated').size() == 0) { $heading = $(this); $expandedSiblings = $heading.siblings().find('ul:visible'); if ($expandedSiblings.size() > 0) { $expandedSiblings.slideUp(500, function(){ $heading.find('ul').slideDown(500); }); } else { $heading.find('ul').slideDown(1000); } } }); }) For now the code works this way: When click on Heading 1, menu is expanded. When click on Heading 2, heading2 submenu menu is expanded and heading 1 submenu is closed. I need to rework it to this: Submenus must be closed automatically on mouseout. Can somebody help me? Thanks in advance!

    Read the article

  • jQuery - disable selected options

    - by Jeffrey
    Need to disable already selected options in select box using jQuery. I'd like it to grey out like asmselect. Test my example here. //JS $("#theSelect").change(function(){ var value = $("#theSelect option:selected").val(); var theDiv = $(".is" + value); theDiv.slideDown().removeClass("hidden"); }); $("div a.remove").click(function () { $(this).parent().slideUp(function() { $(this).addClass("hidden"); }); }); //HTML <body> <div class="selectContainer"> <select id="theSelect"> <option value="">- Select -</option> <option value="Patient">Patient</option> <option value="Physician">Physician</option> <option value="Nurse">Nurse</option> </select> </div> <div class="hidden isPatient">Patient <a href="#" class="remove" rel="Patient">remove</a></div> <div class="hidden isPhysician">Physician <a href="#" class="remove" rel="Patient">remove</a></div> <div class="hidden isNurse">Nurse <a href="#" class="remove" rel="Patient">remove</a></div> </body>

    Read the article

  • jQuery slideDown + CSS Floats

    - by danilo
    I'm using a HTML Table with several rows. Every second row - containing details about the preceding row - is hidden using CSS. When clicking the first row, the second row gets showed using jQuery show(). This is quite nice, but I would prefer the slideDown-Effect. The problem is, inside the details row, there are two floating DIVs, one floating on the left, and one on the right. Now if i slideDown the previously hidden row, the contained DIVs behave strange and "jump around". See this animated gif to understand what I mean: http://ich-wars-nicht.ch/tmp/lunapic_127365879362365_.gif The markup: <tr class="row-vm"> <td>...</td> ... </tr> <tr class="row-details"> <td colspan="8"> <div class="vmdetail-left"> ... </div> <div class="vmdetail-right"> ... </div> </td> </tr> The CSS: .table-vmlist tr.row-details { display: none; } div.vmdetail-left { float: left; width: 50%; } div.vmdetail-right { float: right; width: 50%; } And the jQuery code: if ($(this).next().css('display') == 'none') { // Show details //$(this).next().show(); $(this).next().slideDown(); } else { // Hide details //$(this).next().hide(); $(this).next().slideUp(); } Is there a way to fix this behavior, and to implement a nice slideDown-effect?

    Read the article

  • Why jquery have problem with onbeforeprint event?

    - by Cesar Lopez
    Hi all, I have the following function. $(function() { $(".sectionHeader:gt(0)").click(function() { $(this).next(".fieldset").slideToggle("fast"); }); $("img[alt='minimize']").click(function(e) { $(this).closest("table").next(".fieldset").slideUp("fast"); e.stopPropagation(); return false; }); $("img[alt='maximize']").click(function(e) { $(this).closest("table").next(".fieldset").slideDown("fast"); e.stopPropagation(); return false; }); }); <script type="text/javascript"> window.onbeforeprint = expandAll; function expandAll(){ $(".fieldset:gt(0)").slideDown("fast"); } </script> For this html <table class="sectionHeader" ><tr ><td>Heading 1</td></tr></table> <div style="display:none;" class="fieldset">Content 1</div> <table class="sectionHeader" ><tr ><td>Heading 2</td></tr></table> <div style="display:none;" class="fieldset">Content 2</div> I have several div class="fieldset" over the page, but when I do print preview or print, I can see all divs sliding down before opening the print preview or printing but on the actual print preview or print out they are all collapse. I would appreciate if anyone comes with a solution for this. Anyone have any idea why is this or how to fix it? Thanks. PS:Using a does not work either ( I assume because jquery using toggle) and its not the kind of question I am looking for.

    Read the article

  • jQuery: How to reverse sortable('serialize') arrays from last to first?

    - by Binyamin
    The discussion begins http://stackoverflow.com/questions/654535/jquery-what-to-do-with-the-list-that-sortableserialize-returns/2920760#2920760 How to reverse it from last to first, updateList.php?id[]=5&id[]=4&id[]=3&id[]=2&id[]=1&&action=update? <ul> <li id="oreder-5">5</li> <li id="oreder-4">4</li> <li id="oreder-3">3</li> <li id="oreder-2">2</li> <li id="oreder-1">1</li> <ul> My code: $(document).ready(function(){ order=[]; $('#list ul').children('li').each(function(idx, elm) { order.push(elm.id.split('-')[1]) }); $.post('updateList.php', {'order[]': order, action: 'update'}); function slideout(){ setTimeout(function(){ $("#response").slideUp("slow", function () {}); }, 2000); } $("#response").hide(); $(function() { $("#list ul").sortable({ opacity: 0.8, cursor: 'move', update: function() { var order = $(this).sortable("serialize") + '&action=update'; $.post("updateList.php", order, function(theResponse){ $("#response").html(theResponse); $("#response").slideDown('slow'); slideout(); }); }}); }); });

    Read the article

  • Partial slideDown with jQuery

    - by Jon
    I have some buttons that have drawer menus and what I'd like to do is add a state so that when the user hovers over the button, the drawer bumps out slightly (maybe with a little wiggle/rubber-banding) so that they know that there's a drawer with more information. I have the sliding working and a hover function set up, but I don't know how to implement a partial slideDown. Any ideas? FIDDLE. Code: <div class="clause"> <div class="icon"><img src="http://i.imgur.com/rTu40.png"/></div> <div class="label">Location</div> <div class="info">Midwest > Indiana, Kentucky; Southwest > Texas, Nevada, Utah; Pacific > California, Hawaii</div> </div> <div class="drawer">Info 1<br/><br/></div> <div class="drawerBottom"></div> $(".clause").click(function() { var tmp = $(this).next("div.drawer"); if(tmp.is(":hidden")) tmp.slideDown('3s'); else tmp.slideUp('3s'); }); $(".clause").hover(function() { });

    Read the article

  • jQuery panels - close one when opening another

    - by justme
    I have two slide panel in the same page. Need that, when one is open and the and user clicks on the other one, that makes, at the same time, close the first one when opening the second. Now they are overlapping... Can you help me, please? thanks This is what i have on the page: I have two slide panel in the same page. Need that, when one is open and the and user clicks on the other one, that makes, at the same time, close the first one when opening the second. Now they are overlapping... Can you help me, please? thanks This is what i have on the page <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".btn-slide").click(function(){ $("#panel").slideToggle('fast'); $("#panel2").slideToggle("fast"); $(this).toggleClass("active"); }); }); $(document).ready(function(){ $(".btn-slide2").click(function(){ $("#panel2").slideUp('fast'); $("#panel").slideToggle("fast"); $(this).toggleClass("active"); }); </script>

    Read the article

  • jQuery and MySQL

    - by Wayne
    I have taken a jQuery script which would remove divs on a click, but I want to implement deleting records of a MySQL database. In the delete.php: <?php $photo_id = $_POST['id']; $sql = "DELETE FROM photos WHERE id = '" . $photo_id . "'"; $result = mysql_query($sql) or die(mysql_error()); ?> The jQuery script: $(document).ready(function() { $('#load').hide(); }); $(function() { $(".delete").click(function() { $('#load').fadeIn(); var commentContainer = $(this).parent(); var id = $(this).attr("id"); var string = 'id='+ id ; $.ajax({ type: "POST", url: "delete.php", data: string, cache: false, success: function(){ commentContainer.slideUp('slow', function() {$("#photo-" + id).remove();}); $('#load').fadeOut(); } }); return false; }); }); The div goes away when I click on it, but then after I refresh the page, it appears again... How do I get it to delete it from the database? Thanks :) EDIT: Woopsie... forgot to add the db.php to it, so it works now .<

    Read the article

  • jQuery only apply to current li

    - by kylex
    I want to slide toggle the second level ul when I mouse over the relevant first level li. Currently the script displays all secondary ul on a mouseover. <div id="subNav"> <ul> <li>One</li> <ul> <li>SubOne</li> </ul> </li> <li>Two</li> <li> <ul> <li>SubTwo</li> </ul> </li> </ul> </div> And here is my jQuery $("#sideNav ul li").hover( function(){ $('#sideNav ul li ul').slideDown(); }, function(){ $('#sideNav ul li ul').slideUp(); } );

    Read the article

  • Hide elements for current visit only

    - by deanloh
    I need to display a banner that sticks to the bottom of the browser. So I used these codes: $(document).ready(function(){ $('#footie').css('display','block'); $('#footie').hide().slideDown('slow'); $('#footie_close').click(function(){ $('#footie_close').hide(); $('#footie').slideUp('slow'); }); }); And here's the HTML: <div id="footie"> {banner here} <a id="footie_close">Close</a> </div> I added the close link there to let user have the option to close the banner. How ever, when user navigates to next page, the banner shows up again. What can I do to set the banner to remained hidden just for this visit? In other words, as long as the browser remained open, the banner will not show up again. But if user returns to the same website another time, the banner should load again. Thanks in advance for any help!

    Read the article

  • Javascript FAQ drop down

    - by kdipaolo
    Im trying to create a simple FAQ drop down but for some reason it is not working. Would you mind taking a look? Thanks guys! CSS #faqs h3 { cursor:pointer; } #faqs h3.active { color:#d74646; } #faqs div { height:0; overflow:hidden; position:relative; } #faqs div p { padding:0; margin-bottom:15px; } JavaScript: $(document).ready(function() { $('#faqs h3').each(function() { var tis = $(this), state = false, answer = tis.next('div') .hide() .css('height','auto') .slideUp(); tis.click(function() { state = !state; answer.slideToggle(state); tis.toggleClass('active',state); }); }); }); HTML <div id="faqs"> <h3>This is question 1?</h3> <div> <p>This is the answer to question #1.</p> </div> <h3>This is question 2?</h3> <div> <p>This is the answer to question #2.</p> </div> </div>

    Read the article

  • jQuery Mobile: How to run a callback-function before $.mobile.changePage?

    - by Jugi84
    I'm setting up a mobile app with jQuery Mobile and PhoneGap. What I want to do is that when I click link with id "news_link" I want jQuery to fetch data from database and put it to jQm's collapsible set. In my solution, I've wanted to use $.mobile.changePage inside callback functions because I want to wait until the data has been fetched and put inside the container before the code changes page. Here's the code: $(function() { $('#news_link').click(function(){ loadNewsFromDB(function(){ $.mobile.changePage( $("#news"), { transition: "slideup"} ); }); }); loadNewsFromDB is PhoneGap's SQLite database function which would fetch the data with more callback functions from database. The contents would be put to desired container with .html-function function loadNewsFromDB(){ //some code here theDB.transaction(function(tx) { tx.executeSql(sqlStr, [], onLoadNewsSuccess, onLoadNewsError); },onTxError, onTxSuccess); function onLoadNewsSuccess(tx, results){ //some code here $("#newsSet").html(htmlCodeAndContentToPut); Html is jQm's basic ui-modules: <!-- some html code here --!> <div data-role="page" id="news"> <div data-role="content"> <div id="newsSet" data-role="collapsible-set" data-mini="true"> With debugging I know that the code work up until it works very well unti it arrives to $.mobile.changePage-function. Somehow it doesn't change the page. I've checked the function it works well in other occasions, but not inside callback-functions. I would be very grateful if someone would give me a hand am I not seeing something obviously wrong or is something more specific? What other workarounds there is for fetching the data from SQLite, waiting for data to be fetched, putting the data to container and then changing the pages?

    Read the article

  • JQUERY - how to get updated value after ajax removes data from within it?

    - by Brian
    I have a an element with thumbnails. I allow users to sort their display order (which fires off an update to the DB via ajax). I also allow them to delete images (which, after deletion, fires off a request to update the display order for all remaining images). My problem is with binding or live I think, but I don't know where to apply it. The array fired off upon delete contains ALL the ids for the images that were there on page load. The issue is that after they delete an image the array STILL contains the original ids (including the one that was deleted) so it is obviously not refreshing the value of the element after ajax has removed things from inside it. I need to tell it to go get the refreshed contents... From what I have been reading, this is normal but I don't understand how to tie it into my routine. I need to trigger the mass re-ordering after any deletion. Any ideas gurus? $('a.delimg').click(function(){ var parent = $(this).parent().parent(); var id = $(this).attr('id'); $.ajax({ type: "POST", url: "../updateImages.php", data: "action=delete&id=" + id, beforeSend: function() { parent.animate({'backgroundColor':'#fb6c6c'},300); $.jnotify("<strong>Deleting This Image & Updating The Image Order</strong>", 5000); }, success: function(data) { parent.slideUp(300,function() { parent.remove(); $("#images ul").sortable(function() { //NEEDS TO GET THE UPDATED CONTENT var order = $(this).sortable("serialize") + '&action=updateRecordsListings'; $.post("../updateImages.php", order, function(theResponse){ $.jnotify("<strong>" + theResponse + "</strong>", 2000); }); }); }); } }); return false; }); Thanks for any help you can be.

    Read the article

  • Bind event to AJAX populated list items

    - by AnPel
    I have an unordered list with no list items. I get some information from the user, I run it through my database using AJAX and the servers sends back a JSON object response. Then I append each list item I want to display to the list using something like $('blabla').append('<li>information</li>') My question is, since the li elements were not there at the time the DOM was ready, how can I bind a click event to them? Here is my full code: $(function(){ var timer; $('#f').keyup(function(){ clearTimeout(timer); timer = setTimeout(getSuggestions, 400); }); }) function getSuggestions(){ var a = $('#f')[0].value.length; if( a < 3){ if(a == 0){ $('#ajaxerror').hide(300,function(){ $('#loading').hide(300,function(){ $('#suggest').hide(300) }) }) } return; } $('#loading').slideDown(200,function(){ $.ajax({ url: '/models/AJAX/suggest.php', dataType: 'json', data: {'data' : $('#f')[0].value }, success: function(response){ $('#ajaxerror').hide(0,function(){ $('#loading').hide(100,function(){ $('#suggest ul li').remove(); for(var b = 0; b < ( response.rows * 3); b = b + 3){ $('#suggest ul').append('<li>'+response[b]+' '+response[b+1]+' '+response[b+2]+'</li>') // MISSING SOME CODE HERE TO BIND CLICK EVENT TO NEWLY CREATED LI } $('#suggest').show(300) }) }) }, error: function(){ $('#suggest').hide(0,function(){ $('#loading').slideUp(100,function(){ $('#ajaxerror').show(300) }) }) } }) }) }

    Read the article

  • Help with Collapse and Expand Accordion at same time using JQuery (demo)

    - by Evan
    I'm stuck on an Expand/Collapse accordion using JQuery. After the initial headline is clicked and it expands, if you click to another headline it will collapse the former headline completely FIRST then it will expand the headline you clicked. This collapse first then expand second technique is very distracting and what should happen is as the headline is expanding it should collapse the initial headline. What am I missing? You can experience a demo here: http://media.apus.edu/it/evan-testing/accordion.htm Below is all my work Javascript <script src="http://www.apus.edu/bin/l/y/jquery-1.3.2.min.js" type="text/javascript"></script> <script type="text/javascript"> //<!-- $(document).ready(function() { $(".accordian>li.expanded").removeClass("expanded"); $(".accordian>li h2").addClass("jse").click(function() { var doOpen = !$(this).parent().hasClass('expanded'); var openContainers = $(".accordian>li.expanded").length>0; var targetNode = this; if(openContainers) { $(".accordian>li.expanded h2") .parent() .removeClass('expanded') .end() .nextAll() .slideUp(100,function(){ if($(".accordian>li.expanded").length==0) performOpen(doOpen,targetNode); }); } else { performOpen(doOpen,targetNode); } // if containers are open, proceed on callback // else proceed immediately }).nextAll().slideUp(100); }); function performOpen(doOpen,whichNode) { if(doOpen) { $('html,body').animate({scrollTop: $(whichNode).offset().top}, 1000); //target code $(whichNode).nextAll().slideDown(100).parent().addClass('expanded'); } } //--> </script> CSS <style> .accordian { list-style : none; padding : 0px; margin : 0px; font-size : 12px; } .accordian li { list-style : none; padding : 0px; margin : 0px; } .accordian li a:hover { text-decoration : underline; } .accordian li h2 { cursor : auto; text-decoration : none; padding : 0px 0px 4px 22px; } .accordian li h2.jse { background-image : url(http://www.apus.edu/bin/m/p/toggle_arrow.gif); background-position : 4px -35px; background-repeat : no-repeat; } .accordian li h2:hover { cursor : pointer; text-decoration : underline; } .accordian li li { margin-bottom : 5px; margin-left : 0px; margin-top : 0px; padding : 0px; } .accordian li p { display : block; padding-top : 0px; padding-bottom : 15px; padding-left : 10px; margin-left : 30px; margin-top : 0px; } .accordian li ul { margin-bottom : 30px; margin-top : 0px; padding-top : 0px; padding-left : 0px; margin-left : 0px; } .accordian li.expanded h2.jse { background-position : 4px -5px; } .accordianContainer { margin-top : 0px; padding-top : 0px; } .accordianContainer h2 { padding : 3px; } .accordian_nolist { list-style : none; } </style> HTML <table height="120"><tr><td>&nbsp;</td></tr></table> <div class="accordianContainer"> <ul class="accordian"> <li><h2>Title 1 Goes here - Example</h2> <ul><li> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> </li></ul> </li> </ul> </div> <div class="accordianContainer"> <ul class="accordian"> <li><h2>Title 2 Goes here - Example</h2> <ul><li> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> </li></ul> </li> </ul> </div> <div class="accordianContainer"> <ul class="accordian"> <li><h2>Title 3 Goes here - Example</h2> <ul><li> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> </li></ul> </li> </ul> </div> <div class="accordianContainer"> <ul class="accordian"> <li><h2>Title 4 Goes here - Example</h2> <ul><li> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> </li></ul> </li> </ul> </div> <div class="accordianContainer"> <ul class="accordian"> <li><h2>Title 5 Goes here - Example</h2> <ul><li> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> this is where content goes<BR>this is where content goes<BR>this is where content goes<BR> </li></ul> </li> </ul> </div>

    Read the article

  • Hiding elements based on last closed element jquery script

    - by Jared
    Hi my question is, how can I make this jquery script close all previously opened children when entering a new parent? At the moment it traverses thru all the tree structure fine, but switching from one parent to another does not close the previous children, but rather only the each individual parents elements as a user browses. Here is the jquery I'm using: <script type="text/javascript"> $(document).ready($(function(){ $('#nav>li>ul').hide(); $('.children').hide(); $('#nav>li').mousedown(function(){ // check that the menu is not currently animated if ($('#nav ul:animated').size() == 0) { // create a reference to the active element (this) // so we don't have to keep creating a jQuery object $heading = $(this); // create a reference to visible sibling elements // so we don't have to keep creating a jQuery object $expandedSiblings = $heading.siblings().find('ul:visible'); if ($expandedSiblings.size() > 0) { $expandedSiblings.slideUp(0, function(){ $heading.find('ul').slideDown(0); }); } else { $heading.find('ul').slideDown(0); } } }); $('#nav>li>ul>li').mousedown(function(){ // check that the menu is not currently animated if ($('#nav ul:animated').size() == 0) { // create a reference to the active element (this) // so we don't have to keep creating a jQuery object $heading2 = $(this); // create a reference to visible sibling elements // so we don't have to keep creating a jQuery object $expandedSiblings2 = $heading2.siblings().find('.children:visible'); if ($expandedSiblings2.size() > 0) { $expandedSiblings2.slideUp(0, function(){ $heading2.find('.children').slideDown(0); }); } else { $heading2.find('.children').slideDown(0); } } }); })); </script> and here is my html output <ul id="nav"> <li><a href="#">folder 4</a> <ul><li><a href="#">2001</a> <ul><li class="children"><a href="./directory//folder 4/2001/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder 4/2001/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder 4/2001/doc3.txt">doc3.txt</a></li> </ul> </li> <li><a href="#">2002</a> <ul><li class="children"><a href="./directory//folder 4/2002/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder 4/2002/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder 4/2002/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder 4/2002/doc4.txt">doc4.txt</a></li> </ul> </li> <li><a href="#">2003</a> <ul><li class="children"><a href="./directory//folder 4/2003/Copy of doc1.txt">Copy of doc1.txt</a></li> <li class="children"><a href="./directory//folder 4/2003/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder 4/2003/doc2.txt">doc2.txt</a></li> </ul> </li> <li><a href="#">2004</a> <ul><li class="children"><a href="./directory//folder 4/2004/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder 4/2004/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder 4/2004/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder 4/2004/doc4.txt">doc4.txt</a></li> </ul> </li> </ul> </li> <li><a href="#">folder1</a> <ul><li><a href="#">2001</a> <ul><li class="children"><a href="./directory//folder1/2001/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder1/2001/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder1/2001/doc3.txt">doc3.txt</a></li> </ul> </li> <li><a href="#">2002</a> <ul><li class="children"><a href="./directory//folder1/2002/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder1/2002/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder1/2002/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder1/2002/doc4.txt">doc4.txt</a></li> </ul> </li> <li><a href="#">2003</a> <ul><li class="children"><a href="./directory//folder1/2003/Copy of doc1.txt">Copy of doc1.txt</a></li> <li class="children"><a href="./directory//folder1/2003/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder1/2003/doc2.txt">doc2.txt</a></li> </ul> </li> <li><a href="#">2004</a> <ul><li class="children"><a href="./directory//folder1/2004/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder1/2004/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder1/2004/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder1/2004/doc4.txt">doc4.txt</a></li> </ul> </li> </ul> </li> <li><a href="#">folder2</a> <ul><li><a href="#">2001</a> <ul><li class="children"><a href="./directory//folder2/2001/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder2/2001/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder2/2001/doc3.txt">doc3.txt</a></li> </ul> </li> <li><a href="#">2002</a> <ul><li class="children"><a href="./directory//folder2/2002/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder2/2002/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder2/2002/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder2/2002/doc4.txt">doc4.txt</a></li> </ul> </li> <li><a href="#">2003</a> <ul><li class="children"><a href="./directory//folder2/2003/Copy of doc1.txt">Copy of doc1.txt</a></li> <li class="children"><a href="./directory//folder2/2003/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder2/2003/doc2.txt">doc2.txt</a></li> </ul> </li> <li><a href="#">2004</a> <ul><li class="children"><a href="./directory//folder2/2004/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder2/2004/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder2/2004/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder2/2004/doc4.txt">doc4.txt</a></li> </ul> </li> </ul> </li> <li><a href="#">folder3</a> <ul><li><a href="#">2001</a> <ul><li class="children"><a href="./directory//folder3/2001/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder3/2001/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder3/2001/doc3.txt">doc3.txt</a></li> </ul> </li> <li><a href="#">2002</a> <ul><li class="children"><a href="./directory//folder3/2002/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder3/2002/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder3/2002/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder3/2002/doc4.txt">doc4.txt</a></li> </ul> </li> <li><a href="#">2003</a> <ul><li class="children"><a href="./directory//folder3/2003/Copy of doc1.txt">Copy of doc1.txt</a></li> <li class="children"><a href="./directory//folder3/2003/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder3/2003/doc2.txt">doc2.txt</a></li> </ul> </li> <li><a href="#">2004</a> <ul><li class="children"><a href="./directory//folder3/2004/doc1.txt">doc1.txt</a></li> <li class="children"><a href="./directory//folder3/2004/doc2.txt">doc2.txt</a></li> <li class="children"><a href="./directory//folder3/2004/doc3.txt">doc3.txt</a></li> <li class="children"><a href="./directory//folder3/2004/doc4.txt">doc4.txt</a></li> </ul> </li> </ul> </li> </ul> I assume my problem is, jquery isn't closing the children between each new parent so I need to make a call, but I'm a bit lost on how to do that. I know the code is pretty messy, this project was done in a huge rush and a very tight timeframe. Appreciate your answers and any other constructive comments, cheers :)

    Read the article

  • Jquery hiding all descendents of a ul tag...showing child elements as tree menu...

    - by Ronedog
    I want to hide all the descendents of the "ul" for my tree menu when the page loads up, then as each "main" "li" link is clicked display the direct child, and if the direct child has children (grandchild), when the the "Child" is clicked I want it to show the "grandchild" elements. should be simple, but some how I screwed things up and when i click on the main "li" (Heading 1) it displays all of the descendents (Including the "Sub page A - 1"), instead of just the direct children ("Sub Page A"). Which I think means the children, grandchildren, etc. were never hidden to begin with with the .hide(). What I really want to happen is to hide all the descendents (except the main top-level headings) and as I walk down the tree display the children as needed. Any tips on how to make this work? Here's the HTML: <ul id="nav"> <li>Heading 1 <ul> <li>Sub page A <ul> <li>Sub page A - 1</li> <li>Sub page A - 3</li> <li>Sub page A - 2</li> </ul> </li> <li>Sub page B</li> <li>Sub page C</li> </ul> </li> <li>Heading 2 <ul> <li>Sub page D</li> <li>Sub page E</li> <li>Sub page F</li> </ul> </li> <li>Heading 3 <ul> <li>Sub page G</li> <li>Sub page H</li> <li>Sub page I</li> </ul> </li> Here's my Jquery: $(function(){ $('#nav ul').hide(); //Supposed to Hide all <ul> tags for all descendents, but doesn't work $('#nav>li').mouseover(function(){ $(this).addClass("a_hand") }); //Add the class that displays the hand $('#nav>li').toggle(function() { $(this).find('ul').slideDown(200); }, function() { $(this).find('ul').slideUp(200); });//END TOGGLE });//END MAIN FUNCTION thanks.

    Read the article

  • Not able to delete list which dynamically created with jquery.

    - by shin
    I have two html here. The first one is dynamically generated by php and second one is just html to test. I also have the following jquery. When I click a cross with class delete in the second ones(plain html), it works nicely. However when I click a cross in the first ones, it does not work. It redirect me to the home page with # at the end. I am hoping someone point out what I am doing wrong. Thank in advance. HTML First part (dyanmicall generated) <ul style="display: block;" id="message"> <li class="41"> <span class="user"><strong>shin</strong></span> <span class="msg"> delete this as well</span> <span class="date">2010-01-15 07:47:31</span> <a href="#" id="41" class="delete">x</a> <div class="clear"></div></li> <li class="40"> <span class="user"><strong>shin</strong></span> <span class="msg"> delete me as well</span> <span class="date">2010-01-14 16:01:44</span> <a href="#" id="40" class="delete">x</a> <div class="clear"></div></li> ... ...</ul> Second part which is plain html <ul id="another"> <li><a href="#">you can't delete me</a></li> <li><a href="#" class="delete">delete this</a></li> <li><a href="#" class="delete">delete this</a></li> </ul> Here is jquery $(".delete").click(function(event) { event.preventDefault(); loading.fadeIn(); var commentContainer = $(this).parent(); var id = $(this).attr("id"); // var string = 'id='+ id ; $.ajax({ type: "POST", url: "index.php/admin/messages/changestatus/"+id, // data: string, cache: false, success: function(){ commentContainer.slideUp('slow', function() {$(this).remove();}); loading.fadeOut(); } }); return false; }); I am using CodeIgniter by the way.

    Read the article

< Previous Page | 2 3 4 5 6 7  | Next Page >