JQuery :: Set Target For ScrollTop And ScrollLeft?
May 18, 2010
I am able to get the page to scroll using something like this
$("html:not(:animated),body:not(:animated)").animate({ scrollTop: rw_X, scrollLeft: rw_Y},2000);
I was hoping to be able to target the animate element by using something like this
document.body Is this not possible? What are some targets that allow you to scroll the page (the position of the scroll bars)?
View 2 Replies
ADVERTISEMENT
May 4, 2010
What is the jquery equivalent of document.body.scrollTop / document.documentElement.scrollTop
View 11 Replies
View Related
Sep 3, 2006
I just tested all the browsers I have for support of
document.documentElement.scrollLeft to determine how many pixels the
window has been scrolled to the right. I'm trying to determine if I
really need to go to all the trouble of feature detection for determine
page scroll amount of if the old browsers are old enough now just to
ignore them.
Below are the OS-browser combinations that worked in my test.
OS X 10.4
Safari 2.0.4
Opera 9.00
Firefox 1.5.0.6
OS X 10.3
Safari 1.3.2
Opera 9.00
Firefox 1.5.0.6
(Failed in Internet Explorer 5.2)
Windows XP
Internet Explorer 6.0.2600.000.xpclient.010817-1148
Firefox 1.5.0.6
Opera 9.01
IE 6 was released in August 2001 which is a long time ago so worrying
about IE 5 seems unnecessary for some kinds of web sites. And IE 5 on
OS X is a tiny fraction of people surfing the web.
Does anyone know which are the most recent browsers that would not
support document.documentElement.scrollLeft? Any mobile devices or are
they all running something based on Mozilla or Opera?
View 2 Replies
View Related
Sep 8, 2011
cannot get my first scrollTop to work. What am I doing wrong
<script type="text/javascript"> $(document).ready(function () { alert("got here"); $('#slidetoggle_mini_chapter_0').click(function () { alert("got here"); $('#slidetoggle_mini_chapter_0').scrollTop(300); }); }); </script> <p id="slidetoggle_mini_chapter_0" >Show - 0</p>
it gets inside the click but does nothing with the scrollbar at all.
View 4 Replies
View Related
Feb 15, 2011
I am migrating a site from prototype/scriptaculous to jQuery, and I am encountering a lot of problems with animations in IE. I should start by asking that in scriptaculous, none of these animations require special CSS or tricks for IE (like getting rid of position absolute or anything like that), but this seems to be the case for almost every animation I do in jQuery - is there a list somewhere of all the little hacks and tricks people need to do to get these animations to work in IE? I have re-implemented a few hundred of these animations (mostly crossfades, sliding up and down, highlights), and not a single one worked in IE with the original CSS from the scriptaculous version (in most cases, the other browsers would). In most cases this has to do with absolute positioning. Is it possible jQuery 1.4.4 (the version I am working with) just has massive problems or something because my impression was this library was supposed to be easier to work with, not inordinately more difficult... I just find it hard to believe everyone else is having this many issues with it.
In any event, one thing I can't find any fix for anywhere, is animating the scrollTop of an element (NOT the whole page, which seems to be what everyone else wants to do). I have a div with overflow:hidden, and two buttons underneath which allow the user to scroll through the div (a real scrollbar in this context would not look good or be very useful in comparison).
I ported the code over from scriptaculous, and it works just fine in all normal browsers. Here is the version that would animate scrolling up:
Tested in Firefox/Chrome/Safari just fine right off the bat. But in IE, it just waits and then calls my callback, setting the scrollTop correctly at the end but not actually animating. It's not totally failing, in the sense that the scrolling does happen, and the callback does fire, but it should animate, and I don't really see any reason why it wouldn't. I have set position on the div and all wrapping divs to relative, and static, and set the display value, set the zoom value, widths, heights, everything, but this div will not animate as it scrolls at all in IE only (this is all IE's - 6, 7, and 8). I also tried isolating the div on its own page, removing nearly all the content (leaving text so it will have something to scroll through), practically no CSS outside of width, height, and overflow, and again - does not work in IE only (works in all other browsers without fail).
View 1 Replies
View Related
Dec 6, 2011
I have following code to have a scroll animation effect. The cod eis triggered e.g. by a click.[code]...
The problem is, that the browser (tested in FF, Chrome, IE9) just jumps to the scroll target, no effect is viewable. I googled the code in different places, everybody else seems to have no probs with it.
Any ideas what I'm missing here?
View 1 Replies
View Related
Oct 14, 2010
I'm making this page: [URL] and i want that the menu bar (#menup) be in 100% opacity when .ScrollTob is 0, and 10% when is more than 1. I have this:
$(function(){
$(window).scroll(function() {
if(.scrollTop = 0) {
$("#menup").css("opacity", "1");
}
else(.scrollTop >= 1) {
[Code]....
View 4 Replies
View Related
Nov 16, 2010
So im basically using a link, to scroll through a series of divs to select the correct one.Ie click on happy, and scrolls to 'happy' div, However, the scroll seems to not go to what its linked to, but scrolls to the third div in the list.
[Code]...
View 7 Replies
View Related
Aug 7, 2010
I want to hide a map until it's needed, then when a button is clicked, load the map then scroll to it.Here's my experimentHere's what I'm using:
<div id="themap" class="themap c2">
<br />
<script type="text/javascript">
[code]....
View 4 Replies
View Related
Aug 10, 2009
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-
[code]....
View 2 Replies
View Related
May 18, 2009
I have to use scrollTop and scrollHeight properties, but on jQuery object it returns `undefined`.
Is there any method to get this property from jq object?
It doesn't matter, but my object looks like this:
View 2 Replies
View Related
Mar 25, 2011
I have this bit of jQuery:
$(document).ready(function() {
$('article').click(function(e) {
e.stopPropagation();
[code]....
It works in Chrome, but not Firefox or IE.[URL]
View 2 Replies
View Related
Dec 23, 2010
scrollTop with offset is working - but I get an annoying screen flash occasionally that seems to be the very top of my page.
View 2 Replies
View Related
Dec 4, 2010
I've been trying to implement a smooth scrolling animation in my page, which works fine in firefox and IE8 (haven't tested any older versions yet). But doesn't seem to work in google chrome (and probably safari either I guess). I have 4 divs on my page, positioned absolutely 2 by 2, only one div should be visible at a time, so the body has gotten an overflow:hidden. When an anchor-link to one of those divs is clicked the javascript gets its position,then scrolls towards it. etting the position works, but the scrolling does not work in chrome.
Now, when I remove 'overflow: hidden' from the body element, the scrolling does work in chrome, but of course adds the scrollbars which I don't want.
[Code]...
View 1 Replies
View Related
Aug 19, 2010
I don't know if this is a browser bug. I positioned a div at the bottom of the page just underneath the viewport, calculating it with $(document).height() and animate it to bottom:0, works great even when scrolling, cause of updating with the scroll-event. But when I reload this page or scroll down a bit the original position value was used, so it animates to the original viewport value.
View 1 Replies
View Related
May 19, 2011
i want to submit form data from the popup window, close the popup, and load in the main window. problem is, it always opens a new 'tab'. i'm using google chrome, i didn't think to try this in
in the <head> of the 'main' window:
<script language='javascript' type='text/javascript'>
window.name='main';
</script>
[Code]....
View 4 Replies
View Related
Mar 24, 2011
I am using the following javascript on the target page to open it as top location from within an iframe, which is working ok.
<script type="text/javascript">
if(self!=top) {
top.location.href=location.href
}
</script>
However my problem occurs when the user uses the browsers back arrow to return to the previous page, the script executes again returning them once more to the page they have come from. Is anyone aware of a work around to this problem as it would seem there isn't one? perhaps even a better solution for opening the target page from the iframe as top location. This is really causing confusion for users, and I really need to get the issue fixed.
View 2 Replies
View Related
Apr 13, 2004
function menuDown() {
panel = document.all.panelCategories;
panel.scrollTop += 85;
}
is there a more crossbrowser way to set scrollTop?
View 1 Replies
View Related
Apr 7, 2005
Developing a heavily scripted site which involves a number of scrollable divs.
At times it is necessary to use javascript to control the scroll positions of said divs.
In all but one of the target browsers, setting the scrollTop property works fine. Under IE 5.2 Mac, which, alas, the site needs to support, it does not.
Any one know whether this is even possible in said browser?
View 2 Replies
View Related
May 7, 2007
Im using javscript to show a simple pop up where a user clicks on a page.
the code looks something like this:
var ie=document.all;
var nn6=document.getElementById&&!document.all;
function showBx(e){
bx = document.getElementById('tipbox').style;
bx.visibility='visible'
ty = document.body.scrollTop;
bx.left = nn6 ? e.clientX : event.clientX;
bx.top = nn6 ? ty + e.clientY : ty + event.clientY;
return false;
}
I however find out that document.body.scrollTop doesnt work on IE (works on Opera). Any suggestions/recommendations?
View 1 Replies
View Related
Jul 23, 2005
In the following (IE only) mini page (a table which is supposed
to have a fixed header), when you first do anything with the scroll
bar, you will see the top two rows of the table jump slightly
(a few pixels) down and to the right. I could figure out
a specific numeric fudge factor value that will make me happy
on my own Win 2K / IE 6 system, but I'd like to know a proper
way to make this more general (for other IEs). Code:
View 1 Replies
View Related
Dec 3, 2009
The following script is scrolling my page smoothly, as it is supposed to, in IE and FF however it is not working at all in Safari, any version. The page is:
[URL]
When working correctly, you click the nav buttons in the left sidebar, the page scrolls to the appropriate section.
The script:
$(function(){
$('a[href*=#]').click(function() {
if (location.pathname.replace(/^//,'') == this.pathname.replace(/^//,'')
&& location.hostname == this.hostname) {
[Code]....
View 2 Replies
View Related
Aug 22, 2002
To find the scrolled portion of a screen in legancy browsers you could usually write:
var scrollAmount = (document.layers) ? window.pageYOffset : document.body.scrollTop;
e.g. scrollAmount would contain the value equal to the amount of pixels that the Screen had been scrolled manually by the user using the scroll bars.
How can you using DOM determine this scrolled pixel amount ?
I could image that IE6 is still supporting document.body.scrollTop, but how would you be able to arrive at this using DOM syntax, or atleast.. how do I find it in NS6 ?
View 4 Replies
View Related
Dec 24, 2009
I've placed this on pages where a ^ top of page link at the bottom is present which animates a scroll back to the top of page, however it only seems to work in IE...
Code:
<script language="JavaScript" type="text/javascript" src="_include/_scripts/jquery.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$('a[href*=#]').click(function() {
if (location.pathname.replace(/^//,'') == this.pathname.replace(/^//,'')
&& location.hostname == this.hostname) {
[Code]...
View 1 Replies
View Related
Oct 9, 2011
I want to know what div id I clicked on. My code looks like this:
[Code]...
I want to just know what the value of the div id is, in this case it would be "elem1". I saw .nodeName returns "div" but there's no .idName.
View 1 Replies
View Related
Aug 26, 2010
As I work on a complex navigational menu (complex as in lots of pages and categories) I am trying to figure out how to extract the numerical part of the triggering div's id and then attach it to events within the code, thus using one set of code for multiple menu pairs. A snippet of code is below to show all the uses of the numerical part (using the jDiv plugin from Skyrocket Labs).
var hide01 = false;
$("#nav1").hover(function(){
if (hide01) clearTimeout(hide01);
$("#hidden1").show();
$(this).addClass("active"); } ...... etc
In general someone hovers over the #nav1 div, which in turn reveals the #hidden1 div, same for nav2 & hidden2, nav3 & hidden3, etc. Right now I am simply duplicating the code for each pair, but it would be nice to figure out how to use variables and reduce code size. I understand it is possible to perhaps get the numerical part using
$(this.id).replace('nav','')
But haven't figured out how to attach it to the various values within the code (hide, #nav, #hidden).
View 2 Replies
View Related