Stop From Jumping To Top Of Page?

Sep 11, 2007

Is there anyway to stop the page 'jumping to the top' when using a link like the below?

<a href="#"

.. I just want it to stay in the same position on the page & not jump to the top of the page every time a link like that is clicked.

View 18 Replies


ADVERTISEMENT

JQuery :: Stop Page From Jumping To The Top?

Mar 29, 2011

i've made a menu for my website and i've used to jQuery to create a sub menu on the 'about' section.

the problem is when you click the button, the page jumps to the top.. which i don't want it to do. is there a way round this?

here's the javascript i'm using:

$(document).ready(function () {
$('li.aboutb').click(function () {
$('ul#aboutsub').slideToggle('medium');
});
});

here's a link to the page in question: click me

View 3 Replies View Related

JQuery :: Stop Page From Jumping To The Top OnClick?

Oct 26, 2009

My question is, what do I need to do to stop a browser from jumping to the top of the page when a user clicks on a link which has a jquery function attached to it?So for exampleUser clicks on a link called "Older Stories"Once they do that, jquery will load in some content AJAX styleHowever, browser has jumped to the top of the page and we have to scroll back down again to see the content which has just been loaded in.I've tried putting a return statement in my code but it didn't do anythingHere's my code

var content = $("#ajax_content");
$("#olderstories").click(function(){
showLoading();

[code]....

View 2 Replies View Related

JQuery :: Stop Browser Window Jumping To Top Of Page?

Jul 4, 2009

I'm completely new to jquery and javascript and am just trying to get a simple script up and running. I've put this in the head of the document:

[Code]...

with a div with an id of "togglecontent" and a link with an id of "fadein" in the body about halfway down the page. The toggle works well, but when you click on the link, as well as "togglecontent" becoming visible, the browser window jumps to the top of the page, which obscures some of the toggled div. Is there any way I can stop this from happening?

View 3 Replies View Related

Page "jumping" Back To Top... How Do I Stop It?

Jan 26, 2006

I have a piece of javascript running about mid-section on a webpage. It's doing exactly what I want it to do, but when it runs it also "jumps" the page back to the top. That is, if I have my scroll bar half way down the page, when I click on the link and run this code it jumps me back to the top as if I'm visiting for the first time.

Any ideas on how to keep it on the same spot on the page while still executing the code?

Here is my code:

Code:
function changeOrderDetail(changeTo) {
if (changeTo == "guys") {
document.getElementById('orderDetail').style.backgroundImage = "url(images/subpage_odguysbg.jpg)";
} else {
document.getElementById('orderDetail').style.backgroundImage = "url(images/subpage_odgalsbg.jpg)";
}
}

View 8 Replies View Related

JQuery :: How To Prevent Page Jumping

Nov 8, 2010

have simple slideshow here:n i v o sport.com/i n l i f e/category/2 (please remove white spaces)on the right you will see "More in Travel:" and then arrowsscroll page a bit down and click arrow you will see that page scrolling jumps up. how to keep window positio

View 8 Replies View Related

Image Link Jumping To Top Of Page ?

Jul 22, 2009

I am using a javascript gallery plugin, Galleriffic, to display an image gallery. I am having an issue with it as when the image is clicked it keeps jumping back to the top of the page. The problem with this is that the thumbnails which are underneath the main image on the page aren't visible and the user must then scroll to see them.

Is there any way that I can change this so that the link on the image doesn't make the page jump back to the top? I don't have my version online but the website will show you the code that is being used.

View 8 Replies View Related

Get Code To Execute Inline Instead Of Jumping To Top Of Page?

Mar 13, 2011

so im working on a piece of jquery/JS which executes (drops down a new div) when you click a link. I have the links setup as

<a href="#" id="d0">Execute 1</a>
<a href="#" id="d1">Execute 2</a>
<a href="#" id="d2">Execute 3</a>

And the jscript detects when d0, d1 or d2 is clicked and executes my script. It all works perfectly, however when you click on a link it will jump to the top of the page as a side effect of the a href="#" I assume?

View 1 Replies View Related

JQuery :: Obvious Jumping Of Element From Original Position To New Positon After Loading Of New Page?

Jun 16, 2010

If you go on my test site: [URL]... You will see a navigation menu at the top, with an animated ball. Every time you click on one of the links in the navigation menu, you will notice that after a new page is loaded there is a sudden jump from the balls original position to it's new position. (Not that obvious in Firefox but very obvious in IE and Safari) My question is how can I resolve this.

I assumed that wrapping the code in the $(document).ready function would elimate this issue as everything inside it will load before the page contents are loaded.

[Code]...

View 2 Replies View Related

Get An Alert To Stop A Page From Going On

Nov 6, 2009

I have this button, i would like this button on click to pop up an alert "are you sure".

If yes continue to the url that in the function, if no stay on the page.

Here is the inputter function

So my question is, how do i tie this jquery alert to the button to stop the action.

Right now it pops up but does not stop the page from going to the url.

View 1 Replies View Related

Page Disappearing / Stop This?

Apr 30, 2009

I have a javascript alert which pops up when a user hasnt filled in a form ( php ) but when the alert appears the rest of the page behind it disappears and then reappears when the user presses ok, is there a way to stop this?code...

View 2 Replies View Related

Stop Executing On A Page?

Oct 6, 2011

Is there a piece of code I could put in my website that will allow the same effect as the user disabling javascript in browser options? That would mean that it would stop any javascript from even executing? I would put it on an event.

View 9 Replies View Related

Stop Page From Scrolling On An Onclick?

Jan 21, 2009

<input class='absmiddle' type='checkbox' name='chg' id='chg' onclick='toggle(this); return false;'>

I thought the return false would prevent this but the page scrolls up a bit. What's wrong?

View 2 Replies View Related

The Page Doesn't Stop Loading In FF.

Oct 3, 2007

I have a very simple function. But when it is executed in Firefox the page doesn't stop loading. It works fine in IE6, IE7 and Opera. Here is the code. Very simple as you can see, though it doesn't work in FF.

<html>

<head>

<script type="text/javascript">
function writeTxt() {
document.write('Text');
}
</script>

</head>

<body onload="writeTxt()">

</body>

</html>

View 2 Replies View Related

How To Stop Page Refreshing Constantly

Feb 16, 2010

The code below taken from net works as I need it. onLoad It execute another page from a different page, the only trouble is it keeps on refreshing constantly. How can I stop this??? I'm making it into a function and calling it onLoad.

[Code]....

View 5 Replies View Related

Way To Stop Page Refresh In A Frame Set?

Jul 12, 2009

Is there any simple way to stop page refresh in a frame set? So you return to the same frame set page/pages?(Like firefox does it)

View 3 Replies View Related

How Can I Stop XP 'Large Fonts' Affecting Web Page?

May 27, 2006

I notice when I design a basic HTML page, it
is affected if a WinXP user has Large Fonts set in their Control Panel.
However some pages, e.g. www.bbc.co.uk/news are unaffected by this I think.
They are definitely not affected by changing the font size within the
browser.

Because I want to add tables, which will word-wrap incorrectly if the font
size is changed, how can I disable allowing the browser to do this?

Basically I want the font size to stay how I designed it. If they need it
bigger, they can use the zoom option in more recent browsers. Code:

View 54 Replies View Related

JQuery :: Stop A Page Scrolling When Div Is Toggled?

Jan 11, 2011

I have two divs that are in the same parent div, only one is shown at once. When I toggle the one that is smaller (height-wise), the position of the scroll bar (and hence the user's current location on the page) remains the same. But when I toggle back to the taller div, the scroll bar launches you back up almost to the top of the page.Is there a way I can stop this from happening? I tried return false which i knew wouldn't work. I also looked into scrollTop() but that doesn't seem like it will be of any help since it only returns values and does not set any values?

View 2 Replies View Related

Stop Refreshing The Page When Captcha Is Wrong?

Nov 28, 2011

Here's part of the codes I got from our website. Right now, when someone wants to register on our website, they have to put into the Captcha after they finish all the other information. If the captcha is empty, there would be an alert; if it's wrong, the page would be refreshed, and there would be another alert, and at the same time, all the information would be lost and they have to fill them again. Now the question is, how can I stop the page refreshing itself? All I need is an alert and then you could retype the captcha without losing the other information.

<script type="text/javascript">
function ltrim(stringToTrim) {
return stringToTrim.replace(/^s+/,"");
}
function validateForm()
{
var okSoFar=true
[Code]...

View 4 Replies View Related

Stop Page From Submitting When Refresh Is Clicked?

Apr 6, 2010

When i click on submit button, all the data in form will be inserted into my db. but when i click on refresh the form will be submitted again .. how can i prevent this?

View 2 Replies View Related

Auto Refresh - Stop Page Scrolling

Apr 15, 2010

I'm attaching my php test file but this is a JS problem. When I scroll down in the web page and the meta refresh hits, in Windows Safari and IE6/7/8 browsers, the web page re-positions back to the top. In Opera and FF the page refreshes but it stays where it is. Can someone look at my test script and see why it is not working in IE and Win Safari? My goal is to have the web page not re-position to the top on the auto refresh.

View 4 Replies View Related

Stop Page From Loading After Failed Checkbox?

Nov 26, 2011

I am trying to get to where it will check to make sure either one of the checkboxes are selected, then if not, show alert and do nothing else, but it is still loading the next page in the form action. How can I get this to not load the page when the check fails and only when it passes?

[Code]...

View 2 Replies View Related

Stop Loading Page And Exit If IE Detected?

Feb 1, 2011

IE has a real problem working with my site at the moment and I want to force people to only NON Microsoft browsers for the moment until I get around to fixing the issue (I am only in beta, so its not a major issue)I have seen guides on how to do the detection, and im sure this is a real simple question, but how do i get it to stop loading the page (i.e just provide a blank white page) straight after the popup warning message? this is what i have

Code:
<SCRIPT language="JavaScript">
<!--

[code]....

View 2 Replies View Related

Stop Script From Resizing The Text On Page?

Mar 3, 2011

This script is making all of my text larger.

Code:

View 1 Replies View Related

Stop Refreshing Page When Captcha Is Wrong?

Nov 28, 2011

Here's part of the codes I got from our website. Right now, when someone wants to register on our website, they have to put into the Captcha after they finish all the other information.

If the captcha is empty, there would be an alert; if it's wrong, the page would be refreshed, and there would be another alert, and at the same time, all the information would be lost and they have to fill them again.

Now the question is, how can I stop the page refreshing itself? All I need is an alert and then you could retype the captcha without losing the other information.[code]...

View 3 Replies View Related

Stop Tabs With Query Strings From Reloading Page?

Aug 18, 2009

I have a set of tabs that are set with an href that adds a query string to the url such as "?t=1", meaning the first tab is selected.

Technically it works just fine but every time I click a tab it reloads the page and I'm not entirely sure how to stop this.

I'm using a jquery plugin to handle the query strings. Here's the plugin [URL].

Here's the piece of the code that matters:

var url = location.search;
var tab = $.query.get('t');
init(tab);
function init(tab){

[Code]....

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved