Hi, i’m new to this forum and I’m approaching to jquery with a sitepoint production “Jquery novice to ninja”.
I’m testing the “Ajax load” method, and I’ve got this code:
it works, but I would like to transform the #bio in a toggle button, rather then a #div with a link, so I can switchon and switchoff everytime I want on the html that I load with this method.
It’s possible? I’ve tried several solutions, but nothing, (I’m not so prepared!!! )
That would seem to be as easily as replacing the link with a button with the location in a different attribute such as value, and using ‘#bio button’ instead.
but I’d to put biography and contact informations in the index.html.
Now I need one button that load another html in a div on the index page with the .load (url)
But I want that this button has the toggle behaviour.
thanks paul…
I’m tying to follow your reasoning
I supose that //Add content to div must be replaced by:
var url = $(this).attr(‘href’);
$(‘#divMain1’).load(url);
e.preventDefault();
It’s right?
sorry i’m just approaching for the first time to jquery…with your and other help I would like to understand quickly this language…
hi paul…
I’ve solved and it was very simple…
I’ve tied with yoour code but it still didn’t work…so I’ve thought and I’ve tried to give two jquery instructions in the code:
I’ve assigned a toggle function to the “#div”
I’ve assigne the .load function to “#div a”
in this way it works good…
but now I’ve got a new problem…
I’ve a page with a jquery script to modify a div scrollbar (shape, color, behaviour…)
when I test it works so good, but when I load in a div on the index.html with jquery function .load(url), jquery scrollbar is not visible…I think it’s a jquery conflict, but I don’t understand where it is…can you help me or I must open a new tread?
thanks a lot…you helped me a lot to activate my brain…