JQuery :: .show() And .hide() Causing Page To Scroll Top?

Jan 20, 2011

I have 2 fixed divs in the site I'm developing. One of them is just a tab and the other div is a contact panel. These divs alternate - if the user clicks on the tab, the tab is hidden, and the panel shows and vice versa. Everything works great. Except that when I click on the link to hide either tab or the panel, the page behind it scrolls to the top. I would like the panel to show/hide but for the page behind it to be unaffected.

// Configure Contact Us panel on page load
$('#contacton').hide();
$('#contactoff').show();
var contacting = false;

[Code].....

View 5 Replies


ADVERTISEMENT

JQuery :: Call To FadeIn() Within A Loop Causing Page To Scroll Up?

Feb 18, 2010

I am using a timer to fadeOut and fadeIn some articles such that 5 articles are displayed in rotation.However, for some reason the call to fadeIn or fadeOut is causing the page to change it's y scroll position. If I am currently at the bottom of the page, the fadeIn call causes the page to scroll up.

View 2 Replies View Related

JQuery :: Hide / Show Based On Scroll?

Mar 29, 2010

I've got a fixed div that has a fixed tab as a trigger. I'd like to only show the trigger tab when the user scrolls down the page "X" pixels from the top (say like 200px). Can someone point me in the direction of implementing this?

View 4 Replies View Related

JQuery :: Toggle Function - Hide/show Table When Hide/show Button Is Pressed

Sep 12, 2011

I am trying to hide/show table when hide/show button is pressed

Problem: The code works fine when I remove 'slow' from line 10. But with 'slow' in line 10 content of toggleButton doesnt change from Hide to Show when pressed.

Code:

View 1 Replies View Related

Show Hidden Element On Page Scroll?

Jul 7, 2011

Looking for a simple way to have a hidden element made visible when the page scrolls.

The idea is to have a back arrow appear only when the page has been scrolled horizontally.

trying something along these lines without success . code...

View 3 Replies View Related

JQuery :: Show / Hide Multiple DIVs On Page?

Jul 11, 2011

I have a little issue with trying to hide / show multiple divs on my page. I am using a class name for the divs but the name is generated by a field have set in my database. So for example
<div class="General">Ttitle 1</div>
<div class="General">Ttitle 2</div>
<div class="General">Ttitle 3</div>
<!-- and my link is -->
<a href="#" class="toggle" title="General">Toggle 1</a>

And then say I have
<div class="Questions">Ttitle 1</div>
<div class="
Questions ">Ttitle 2</div>
<div class="
Questions ">Ttitle 3</div>
<!-- and my link is --><a href="#" class="toggle" title="
Questions ">Toggle 2</a>

What would be the easiest way or the best way to code out the jquery to hide / show all the divs with the same name as the links title i can do code jquery to toggle 1 div but not sure how to code it so that it will hide / show all the divs with the same class name.

View 5 Replies View Related

Show Images After People Scroll Down The Page - Don't Load Them Immediately?

Sep 21, 2011

show images after people scroll down the page - don't load them immediately after the page is loaded.also the images which are below the scroll should be first loaded when an user scrolls down.i need a javascript for that, but i don't want jquery! the code should be as short as possible.

View 2 Replies View Related

JQuery :: Causing Blank Page In ASP .NET Master Page Environment

Jul 20, 2010

I have a page that's built using ASP.NET and using a master page.Page contents shows up for a moment then I get a blank page - when I run it. If I remove the jQuery code from my page - then I get the contents.

I tried putting the following in the master page.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" >
</script>

View 2 Replies View Related

JQuery :: Cycle Causing Page Jump?

Jun 23, 2010

I believe I'm having an issue with the jQuery Cycle plugin. For the duration of the occurrence of a transition, the page appears to be "jumping" due to the fact that the site content is centered vertically and horizontally and the transition is making (inactive) scrollbars disappear entirely. I have not witnessed this personally in Safari/Firefox on Mac or Firefox/IE8 on Windows, but a colleague took a video of it happening on their machine with Firefox (Mac). Some see this problem, and others don't—I haven't been able to narrow it down. I also can't put overflow:hidden; on <body>, as I need the site to scroll if the browser window is too small.Here's the video, it's a 1.8 MB QuickTime file:[URL]

View 1 Replies View Related

Hide - Show - Div - On Loading The Page

Dec 20, 2009

I'm trying to have a div be hidden on loading the page but when you click a link it will show the div...

Here's code I have but it doesn't show when you click the link...

View 1 Replies View Related

Show / Hide DIV With No Page Reload?

Oct 26, 2011

I am running a simple show hide div script as follows:
<script type="text/javascript">
<!--
function toggle_visibility(slideshow) {
var e = document.getElementById(slideshow);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}

//-->
</script>
<a href="#" onclick="toggle_visibility('slideshow');">Show Gallery + </a>
<div id="slideshow" style="display:none">slideshow</div>
It works but the page reloads and returns the user to the top of the page not to the "shown" div. Any way to send them back to the shown div or stop the reload?

View 1 Replies View Related

Hide And Show Div On Page Load

Apr 2, 2006

I am trying to use javascript to hide a div before the page loads. Unfortunately for a brief second I can see the div on the page before the java script hide it. Is there anyway to set the javascript to hide the div before the page completely loads?

<script type="text/javascript" src="prototype.lite.js"></script>
<script type="text/javascript" src="moo.fx.js"></script>
<script type="text/javascript" src="moo.fx.pack.js"></script>
<script type="text/javascript">
var forgotpass = document.getElementsByClassName('forgotpass');
window.onload = function() {
forgotpass = new fx.Combo('forgotpass', {height: true, opacity: true, duration: 500});

// Hide Div
forgotpass.hide();

}
</script>

P.S. I'm using the hide function within the moo.fx.js file found @ http://moofx.mad4milk.net/. If there is an easier way to di by just write the javascript out in the onload function please let me know.

View 3 Replies View Related

Show Hide Page Elements?

Jan 11, 2011

I have a page that is generated using php. Below, the pdf newsletter for each month is embedded directly into the page. What I want to do is have some javascript that when the link for a month is clicked, the embedded pdf expands below and when the user clicks on another month, that newsletter is hidden then the one they clicked on gets displayed; so only one newsletter is displayed at a time.

View 3 Replies View Related

JQuery :: .click() Causing Page To Reload Once Function Completed?

Sep 20, 2010

I'm using a .click event handler to add new classes to 9 list items. It does this perfectly, but once it's been clicked it reloads the page and everything resets!Here's the jQuery:

$("#diamond").click( function() {
$("#storage ul li#1").addClass("box1-diamond");
$("#storage ul li#2").addClass("box2-diamond");

[code]....

View 2 Replies View Related

JQuery :: FadeIn / FadeOut Causing Browser To Jump Up Page?

May 29, 2009

I have a very simple image rotator that brings in images then rotates through them using fadein/out.

You can see it going here: [URL]. If you scroll down to the bottom of the page then wait a few seconds the main image will rotate and the browser will jump up (almost as if it's going to an anchor).

The images are brought in to a 100% div and the images are specified to 100% width (not sure if this is related but I'd thought i'd let you know!).

The code I'm using is this:

function run_slides(id){
var curid;
var nextid;
curid=id;

[Code].....

View 1 Replies View Related

JQuery :: A Script On Page Is Causing Internet Explorer To Run Slowly?

Aug 6, 2009

I got this message when i try to open the main page of my applicationpankaj.site in IE 6 or IE 7. This is working fine in Firefox, Safarietc."Stop running the script?A script on this page is causing IE to run slowly.If it continues to run, your computer may become unresponsive."After I clicked the "Yes" button, then the loading message came up andstopped there.

View 1 Replies View Related

Show/hide Div Tag Should Not Change On Page Refresh?

Jul 4, 2009

I am having a html file with show/hide functionality using javascript. If I click "more link" then I can see more links with "hide" link at the bottom. On clicking hide link its getting hide. My problem is, if I click "more link" and I refreshed the page. Again all the links get hidden. I want those links should be hidden only on clicking the "hide link". Not for every page refresh.

Here is my html code:

<script language='javascript' type='text/javascript'>
function showHideDiv()
{
var divstyle = new String();
divstyle = document.getElementById('moreDiv').style.display;

[Code]....

View 2 Replies View Related

Show / Hide Divs Based On POST Value Sent From Another Page

Apr 26, 2011

The two page sections you see on the page "One Time Gift" or "Monthly Subscription" are normally hidden via a document.write via a body onload. Generally, all of this functions well. But, I want to expand the use a bit here so I want to pass a $_POST value to this page from another page which hides or shows these two sections based on this passed value. So, if the value in "once", I want the div with the id="onetime" to be visible and the other div to be hidden. If the value is "monthly", then the opposite would happen. Now this is supposed to all happen as the page loads because we are just arrivng here from the sending page.

View 9 Replies View Related

How To Link To A Page With Different Default Show / Hide Tab Showing

Aug 2, 2009

I'm not allowed to post a link yet since I'm a newbie. But the page is here: tinyurl dot com /m8ajyp

This page (and others on the site) use javascript to show/hide some divs in order to have a tab-like interface.

Is there any way to link to this page with the "Past Events" div showing as the default? Right now you can see that "Coming Events" shows on page load. And that's the way we want it most of the time.

But there are places in the site where I'd like to link specifically to this page with the "Past Events" div showing on page load.code...

View 7 Replies View Related

Page Load The Boxes Show And Then Slowly Hide?

Jun 23, 2011

I need to see if I can shorten this AND see if I can have a "show all option" added.The page is setup like so.. I have the following javascript working.. I'm running jquery... being a semi newbie it took a while to get this running.I have 4 DISTINCT queries that load up select boxes.There are 4 select boxes .. on change, the queries will see what option was selected and re-run DISTINCT SQL queries so all the select boxes only have related info.. so no one ends up with a "zero" results.I'm hiding these to help walk through in a logical order. However I need to1) Have a show all and let them select anything they wish and show all 4 boxes. How can I add a "show all" to the script below2) I noticed on page load the boxes show and then slowly hide. THis looks messy.. how can I alter that?3) This seems long for what I'm doing.. is there a way I can shorten this code? What if I expand to 8 boxes.. then I'll have 8 simple if statements.. but it seems unnecessary.CODE that is working is

$(document).ready(function () {
if ($("#pMaterial option").is(":selected"))
{

[code].....

View 1 Replies View Related

Show And Hide Multiple DIVs On Page - Add Cookies?

Jul 12, 2009

I use this script to show/hide multple divs on a page. I am trying to adding cookies to this script.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]">
<html xmlns="[URL]"><head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Show Hide</title>
<script language=javascript type='text/javascript'>
function hideSpan(pass) {
var spans = document.getElementsByTagName('span');
for(i=0;i<spans.length;i++){
if(spans[i].id.match(pass)&&spans[i].style.visibility){
spans[i].style.visibility=spans[i].style.visibility=="hidden"?"visible":"hidden";
}}}
</script></head><body>
<span id="256a" style="visibility:hidden;" >
My content<br/>
</span><span id="256b" style="visibility:hidden;">
<br/></span>
<span id="512a" style="visibility:hidden;">
<br/></span>
<a href="javascript:hideSpan('256')">show/hide span 256</a>
<a href="javascript:hideSpan('512')">show/hide span 512</a>
</body></html>

View 3 Replies View Related

JQuery :: Hide Scrollbar And Still Be Able To Scroll With Mouse?

Jul 28, 2011

I know how to hide the scroll bar but not how to enable scrolling.

I did google a bit and found some solution that did not work for me. (currently using crome on mac) code...

Does anyone know a good way of doing that?

View 1 Replies View Related

Make An Image/text To Scroll As The User Scroll The Page Also?

Sep 25, 2009

how to make an image/text to scroll as the user scroll the page also? for example if the user scrolls down image/text also scrolls down and when the user scrolls up image/text also scrolls up..

View 6 Replies View Related

Make A Div Tag And Its Contents Scroll Down The Page Automatically When You Scroll?

Jun 13, 2006

Does anyone know of a script that makes a div tag and its contents scroll down the page automatically when you scroll?

View 2 Replies View Related

JQuery :: Detect Touch Screens - Hide The Scroll Bars

Mar 1, 2011

Is there a way to use jquery to detect any device with a touch screen?

Im using the jscrollpane but the handles drag in the wrong direction on touch screens like the ipad (in my opinion). As you can drag the main content (which works in the correct way), I want to hide the scroll bars if the device is a touch screen.

View 2 Replies View Related

AJAX :: Script Causing Automatic Page Reload?

Jun 8, 2009

I'm writing a script, part of which calls an AJAX request to populate a table. This script runs when the page is first loaded and when different buttons are clicked on the page (I won't go into the details here). It works just fine when the page is first loaded, but whenever the function is called from any other event on the page (onclick, etc) it performs the function, but then proceeds to reload the whole page!

I've spent a long time debugging and trying to figure out exactly where the trouble is starting, and the only thing I can think is that some sort of "reload page" command is being sent to the browser somewhere that I'm not seeing. In Firefox, after the request is complete and the response data is written to the page, the page reloads. However, in Safari, the page reloads after the readyState is 1, so the request hasn't even been sent yet.

Here is the offending function:

Javascript Code:

function fillLogTable(date, org, poc, name)
{
document.getElementById("visitLogTableDiv").innerHTML = "<br />Loading...";
//fetch the logs

[Code]....

View 2 Replies View Related







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