473,811 Members | 2,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Snap to top of page...

Hello,
I have not done much javascripting so this might be really easy. I have
a page that has anchors in it and I want to force that page to always
snap to the top instead of to the position when someone clicks on the
href to takethem to the anchor.

Thanks,
- Charles

May 6 '06 #1
4 1562


Rephase your Q, I don't follow.

Danny
May 7 '06 #2
ASM
he*****@llnl.go v a écrit :
Hello,
I have not done much javascripting so this might be really easy. I have
a page that has anchors in it and I want to force that page to always
snap to the top instead of to the position when someone clicks on the
href to takethem to the anchor.

<a href="#">top</a>

<a href="#anAnchor "
onclick="locati on='#';return false;">false anchor</a>

--
Stephane Moriaux et son [moins] vieux Mac
May 7 '06 #3
Thanks,
I did find what I was looking for. Since I don't know JS very well I
was not sure how to put it. Anyways, I added
onfocus="window .scrollTo(0,0); " to my body tag and everything is now
working.

- Charles

May 7 '06 #4
he*****@llnl.go v wrote:
I did find what I was looking for. Since I don't know JS very well I
was not sure how to put it. Anyways, I added
onfocus="window .scrollTo(0,0); " to my body tag and everything is now
working.


For suitable values of "to work".

- It will break with a runtime error (ReferenceError or TypeError) where
client-side scripting, but not this proprietary method, is supported.[1]

- It is not Valid markup, and will silently fail where this proprietary
attribute is not supported.[2]

- It will be an annoyance for the rest of the users.[3]

Why don't you go snowboarding instead?
PointedEars
___________
[1]
<URL:http://developer.mozil la.org/en/docs/DOM_Client_Obje ct_Cross-Reference:windo w>
<URL:http://developer.mozil la.org/en/docs/DOM:window.scro llTo>

<URL:http://msdn.microsoft. com/workshop/author/dhtml/reference/methods/scrollto.asp>
[2] <URL:http://validator.w3.or g/>
<URL:http://www.w3.org/TR/html4/index/attributes.html >
[3] <URL:http://codestyle.org.u k/javascript/FAQ.shtml#suppr essctrln>
--
This above all: To thine own self be true.
-- William Shakespeare (1564-1616)
May 17 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6842
by: Rhonda | last post by:
Using AccessXP I have lost snap to grid on my system. New or existing databases do not snap to grid for forms and reports in design view. Anyone have an idea on how to get it back?? Thanks. Rhonda
3
1665
by: Shrage H. Smilowitz | last post by:
Can someone guide me to what is involved to take a snap shot of a web page using .Net, i kow there is third party components that allows to do that, but i want to create my own. Shrage
2
5000
by: SStory | last post by:
I have a picture that I allow the user to move around and would like to offer grid support like VB and other apps so that it will snap to the nearest point. How can I offer grid support so that the image will snap in place on grid points like a commerical app? I am not sure how to implement that. Anyone have any code? Thanks,
6
4541
by: Jim Hubbard | last post by:
Anybody seen an example of a snap-in GUI done in VB.Net?
1
3827
by: Marc Gravell | last post by:
For a bespoke control, how can I implement my own designer snap lines in VS2005? I remember finding an MS article once, but I now can't re-locate it. Basically, I have a custom-control that comprises e.g. a TextBox and some other things; I don't want to do anything too clever - I just want to forward the snap-lines on my control to inherit those from the TextBox, mainly for the "bottom of the text" snap line (for want of a better term) -...
1
1590
by: Driez | last post by:
I recently installed .Net Framework 2.0 on my computer. I have developed a snap in c# using a library from sourceforge (http://sourceforge.net/projects/mmclibrary/) on Visual Studio 2003 When I run my MMC project in debug mode from Visual Studio 2003 the mmc starts up but crahes immediately. An hourglass appears and then the MMC crashes. I have set up my project settings to start the program mmc.exe with a command line argument of...
0
1910
by: Brian Henry | last post by:
Ok I've never implemented a snap location before so I dont really know what im doing wrong here... anyways, I am making a custom slider control that takes dates as its values instead of integers... then taking that date range and finding dates specifiec between them (in a list of dates) and putting snap marks, so if you slide it near one of them it should snap to that tick, but that part i cant figure out. the rest seems ok so far... here...
3
1321
by: Chris | last post by:
I have a page that displays a datalist of multiple data items. In each dataitem I have gridviews that are pagable. It looks simular as I show below. I just want a way of hitting the gridview paging number on an item not to cause the page to snap back to the top of the page. Rather I would want it to stay exactly where it's at. Is there something I can put in the code behind (C#) in pageload that will say snap back to where I was? ...
2
1579
by: Razzbar | last post by:
I was wondering if anyone has experience with snap.com's service, where you put a reference to a remote script on your page. The script causes a small snapshot of a web page to appear wherever the user mouses over a link on your page. This is very simple to implement on a static page -- paste in one line of code. But what about when you have a dynamic page with content pulled in by AJAX requests? On a static page, the script is loaded...
0
9727
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10386
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10398
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.