JQuery :: ScrollTo - Contents Is Always In The Centre Of The Screen
Nov 4, 2010
I am making a side scrolling site and can get the jquery ScrollTo to work fine but I need to apply a targeted postion of 50% so that the contents is always in the centre of the screen. I am following this [url] but I do not know where to put the code for this "A string specifying a percentage to scroll to that part of the container (f.e: 50% goes to to the middle)."...which he has stated in a post is "$('#the_div').scrollTo('50%',900, {axis:'x'});" but I don't know where to place it.
I have a link, and when it's clicked, a javascript popup appears. However, the popup appears on the right hand side. Is there any way that I can adjust it to make it appear at the centre of the screen?
This is what I have so far:
<SCRIPT language="JavaScript"> function openwindow() { window.open("index.php","mywindow","menubar=0,resizable=0,width=725,height=1000"); } </SCRIPT>
how can you centre your website in a browser. It can be done using NetObjects Fusion 8, but I'm no longer using it. I'm now using Frontpage 2003, it could of been done using vbscript or javascript,
I have a div with an image in it that when clicked steps the page to the right by 600px
this is it: .click(function(){ $.scrollTo( {top:'-=0px', left:'+=600px'}, 800 ); });
What i want to do is remove the button when the page cant scroll any further to the right. then re add it when i go left again. if this makes any sense!
At Jquery and I'm trying to get ScrollTo to work. There is a lot of info at [url] but it's not geared toward absolute beginners (ie. there seams to be a lot of unsaid steps). I'm trying to make the queue effect work where the window scrolls both the x and y axes with custom duration (2000 or 700 etc.)
I was peaking around on the W3C site to see if I could find a clear definition of which characters are allowed within an ID.The problem is that I have a series of divs that have id="aq-1234" "cd-456" etc. I have no real control over the - in the name. What would be another way of clearly identifying an object without the id? <td id="aq-1234"> is what I have now. I've not used the rel="xxx" that I see some people use. Would that be acceptable? Clearly $("#aq-1234") is not.
im trying to run .scrollto to jump from one div to the next with a smooth animation in a horizontal website. this is what the head tag looks like so far
i tried removing either local scroll or scrollTo and see if there was a conflict but that wasnt the case. ive seen the script run on a webpage without having to add $.localScroll();to every link, right now it just doesn't move at all.
I have some moving objects & they are using the top left spot of the object to 'hold' or 'pivot' off. how i make the 'pivot' point in the centre of the image. I think it is somewhere in this section of code:
ill admit im extremely new to jquery i come from the flex/flash world and looking to see what the hype is allo about. with that being said. im trying to perform a simple screen scroll after all this code has run but nothing seems to work
I am using jScrollPane on this Wordpress-powered site [URL]... rporation/ at the right for the logo thumbnails. Now I want to use the [URL]..... ollTo.html functionality to vertically align the thumbnail of the current project so that people don't get lost in navigation. In other words: on page load, the jScrollPane should auto scroll to the thumbnail which belongs to that project. I've managed to give the current thumbnail a class called 'currentthunb'.
I'm using the following script to successfully scroll links, however, I am having trouble getting the page to focus on the hash target. Instead, the page focus stays with the link that initiates the function rather than the intended target:
$(function(){ $('a[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){ var targetOffset = $target.offset().top; $('html,body').animate({scrollTop: targetOffset}, 300); $(this.hash).focus(); // Not working return false; } } }); });[code]....
I've tried using this.hash (as above) and it doesn't work, though I can set the focus to the top of the page like so (not what I want): $('html,body').focus();
I currently have a webpage that scrolls between content divs with a little 'next' 'prev' next to each div them, it works fine but when you view on a larger res screen you see more than just one set of 'next' 'prev' which leads to confusion, I would like to have two fixed nav's that navigate between the parts of the page
I am using the below function to scroll to sections on a menu. It works but I need the links that activate the scrollto to still be links to pages. If I change "return false;" to "return true;" this links to the pages but the scrollto function does not work. Is there anyway it can do both?
$(function(){ var $pane = $('#scroll-pane'); $pane.jScrollPane({animateTo:true}); $('a#scroll-to').bind(
I have problems setting an offset of the LocalScroll-plugin (and the ScrollTo)[URL]If you click on one of the links (main-section), you'll see the divs are not lining up right. I guess it's about scroll to goes to div+padding+margin. Right? So, I'll have to adjust an offset.
Does anyone know of a way to prevent tabbing (via keyboard tab key) between form fields in ifferent "slides" when using the jquery scrollTo plugin? For example, I have a UL with 2 LI's in it and each LI has a <form> inside of it. If a user is on slide 1 and hits tab on the last visible form field, the first form field on the next slide comes into view (because the browser gives it focus), thus moving slide 2 partially into view. The same kind of thing happens from slide 2 to slide 1 when shift-tabbing (tabbing backwards): a form field on slide 1 gets focused and comes into view. I'd like to prevent tabbing between the forms. To complicate matters a bit more (possibly), one of my forms has a jquery UI tab control on it, so the last visible form field could be any field on any of the tab control's tabs (ie: the "last" visible form field depends on what tab is showing.
but i have these basic functions to show a div and all i would like to do after these run is to actually make the screen scroll to the bottom here is my code i know is wrong can you please point me in the right direction.
I have this tweet ticker code that scrolls a live feed at the very top of the header. It runs on jQuery 1.5.0. The site I have has a vertically scrollTo div for each button pressed on the navigation. The problem I'm having is that as soon as I plug in the jQuery 1.5.0 which turns on the tweet ticker, it stops the overflow and the scrollTo. So when I click on any of the navigation buttons it jumps to the next page rather than scrolling smoothly.
I'm trying to add scrolling buttons that scroll the page onmousover. They work great, however, since the duration is a fixed value, and the distance changes based on how far the user scrolls, it sometimes scrolls fine (when the distance and duration are proportioned), and very slow (when the duration is way higher than the distance)...
Is there any way to change the duration based on the distance?
To make some sort of "speed" setting, instead of a constant duration?
I'm looking for javascript to analyze the contents of a textbox and replace the contents with the appropriate date. To make that a little clearer, if the user types 'tomorrow' then when they tab/move onto the next text box the 'tomorrow' text should be replaced with the date for tomorrow in the format dd/mm/yyyy, if the user enters '1 week' then the text should be replaced with the date in one week in the format dd/mm/yyyy etc.