Response title
This is preview!
I know this is caused by:
jQuery(document).click(function(){
but, when I try to replace this with anythiung else like:
jQuery(document).ready(function(){
for example, it no longer works. As far as i can remember the (document).click fucntion is there completely by accident and yet its needed for it to work properly, what am i missing?
jQuery(document).click(function(){
jQuery('.toggle-on').click(function(){
jQuery('.post-info').addClass("post-info-toggle-off");
jQuery(this).addClass("toggle-off");
jQuery(this).removeClass("toggle-on");
});
jQuery('.toggle-off').click(function(){
jQuery('.post-info').removeClass("post-info-toggle-off");
jQuery(this).addClass("toggle-on");
jQuery(this).removeClass("toggle-off");
});
jQuery('.list-toggle').click(function(){
jQuery('.post-text').hide();
jQuery('.post-list').show();
jQuery('.info-toggle').addClass("toggle-off");
jQuery('.info-toggle').removeClass("toggle-on");
});
jQuery('.info-toggle').click(function(){
jQuery('.post-text').show();
jQuery('.post-list').hide();
jQuery('.list-toggle').addClass("toggle-off");
jQuery('.list-toggle').removeClass("toggle-on");
});
});
All of your other click functions are nested in a click function, which is just a Bad Thing TM
If your other clicks do not work in the document ready handler then there must be something else that you're not sharing with us.
So your user's first click is your$(document).ready!)Yes exactly, but this isnt satisfactory to me.
I'm using wordpress and just putting this code in the footer for teh time being, when i use the '$' it doesnt work, i dont really understand why.
© 2013 jQuery Foundation
Sponsored by and others.