Hi to everyone
I’ve got a wrong behavior when I try to use a toggle button in this site: www.giovannicaccamo.eu
The toggle button is on footer and it is “Privacy Policy” div.
It use the same jquery code used for the “Bio” div and they work fine on my pc but online I have got a strange behavior.
Any idea?
I remember I’m a beginner…
Thanks
Here is the code that you are using for both the bio and the portfolio sections:
$('#bio').click(function() {
$('#divMain2').toggle('slow', function() {
//qui possiamo far eseguire altre funzioni correlate
$('.scroll').mCustomScrollbar(); //edited
});
});
$('#portfolio').click(function() {
$('#box').toggle('slow', function() {
//qui possiamo far eseguire altre funzioni correlate
});
});
It seems that the selector in the portfolio area is the cause of the problem. Changing #box to #divMain2 should result in an improvement there for you.
This “page” is set up as a complete real html-page, with the <html><head></head><body></body></html> construction.
But in fact it should be only a code fragment, which is directly inserted by the javascript in the html-code of the main page (which has already the <html><head><body>).
What happens: via the <head> in the policy.html not only the stylesheet is loaded for the 2nd time but also the script.js for the 2nd time (which commands the toggle function: again)! > Confusion for the browsers.
So I think the problem can be solved by removing everything besides the <div id=“divPolicy”>… and what’s in it … </div>.
Hi Francky thanks a lot. Your suggestions were right.
I’ve solved modifying the policy.html erasing the <head> section.
Now I’ll check all the code errors with html and css validator and I’ll try to fix them.
I’m trying to learn by building noprofit (for me) web sites for friends…