In jQuery 1.4.4 I could load a JSON file from subdomain2.website.com to subdomain1.website.com without any problems. When I upgraded to jQuery 1.5 this didn't work anymore. What happened?
Is this a jQuery bug or am I doing something wrong?
$.getJSON("http://subdomain2.website.com/resources/data.json", function( data ) {
I have a problem with the animate function in Safari on iPhone 3.1.2. If I click a div with id #link, that has a click handler like this: $('#link').click(function(){ $('html,body').animate({scrollTop:$('#bottom').offset().top},5000); }); Instead of animating from the current scrollposition to the #bottom, it always starts from the top. If I want it to scroll from bottom to top, it just jumps directly to the top without animating, with this code: $('#link2').click(function(){ $('html,body').animate({scrollTop:0},5000); }); Maybe I'm doing something wrong, I'm not sure. See the testcase I've made (view it with an iPhone): http://wroug.com/jquery/test.html If it's a bug, is it a known bug? --
Hi, I'm trying to create a collapsible list, that only shows the first 5 items, and hides the rest. If click the link it will slide in the rest of the list items, and if I click the link again it will hide the expanded list items. How can I do that? and is there a better way to do this? <head> <script type="text/javascript" src="http://ajax.googleapis.com/ ajax/libs/jquery/1.3.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { var list = $('ul#myList'); var original_height = list.height(); list.css({height:$('#myList li').height()*5}); $('a#myList-toggle').click(function() { list.animate({height:original_height}) return false; }); }); </script> <style type="text/css"> ul#myList { overflow: hidden; } </style> </head> <body> <a href="#" id="myList-toggle">Show the rest</a> <ul id="myList"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> <li>Item 6</li> <li>Item 7</li> <li>Item 8</li> <li>Item 9</li> <li>Item 10</li> </ul> </body> </html>
Hi. I have an unordered list like this one: <ul id="myList"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> <li>Item 6</li> <li>Item 7</li> <li>Item 8</li> <li>Item 9</li> <li>Item 10</li> </ul> I want to only show the 5 first items, and hide the rest. I have a link to toggle the hidden elements on and off: <a href="#" id="myList-toggle">Show the rest</a> I use the slideToggle(400) to slide the rest of the list in. Anyone? This is what I have now, it just toggles the whole list. <script type="text/javascript"> $(document).ready(function() { $('#myList').hide(); $('a#myList-toggle').click(function() { $('#myList').slideToggle(400); return false; }); }); </script>