June 21, 201313 yr Hi guys, I found this odd failure in the script, but I can't figure out why the script isn't running correctly in Chrome! It does run in IE and Firefox, what already is strange huh? Here is my test page for the code: http://rowruffdesign.nl/tutorial/test/ I got the script from: http://www.script-tutorials.com/pinterest-like-script-step-1/ I wanted to give this a try It only works after you pressed on Comment on one of the pins, but that isn't a good solution of course. I tried to load the function on page load, but that didn't work! Here is the code that should deal with it: $(document).ready(function() { // masonry initialization $('.mainContent').masonry({ // options itemSelector : '.pin', isAnimated: true, isFitWidth: true }); // onclick event handler (for comments) $('.comment_tr').click(function () { $(this).toggleClass('disabled'); $(this).parent().parent().parent().find('form').slideToggle(250, function () { $('.mainContent').masonry(); }); }); }); Cheers Edited June 21, 201313 yr by Row
June 21, 201313 yr Author I found out when resizing the page, the script also runs! So I guess Chrome is just doing stupid to me Now I need to figure out how to runs this script after all elements load!
June 21, 201313 yr Author Fixed Oeps, it turned out I had to include my JS at the end of my file instate on the top in my header!
July 11, 201313 yr I think thread this should be posted herehttp://www.webdesignerforum.co.uk/forum/68-web-browsers/
Create an account or sign in to comment