- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › CSS DIV problem
I use the following code on my website to have smooth scrolling to sections of my website:
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
If I try to use <a href="#faq">FAQ</a>
, it only scrolls to the top of the page and doesn’t open the pop-up div for this link. Is there a way to work around this?
I think some info is missing here, or it is otherwise unclear…
no info missing…
If you use a code href=”#faq” to be used as a div pop-up, but the JS cancels this out, what would be the workaround?
What controlling the “pop-up”? Other JS? I don’t see that here but how are you sure that isn’t the issue?
It’s ok – I appreciate your effort, but this thread would go on and on and I would only end up getting frustrated.
I created another solution, but I do thank you.