View Full Version : Resolved always on top div
james438
06-06-2011, 08:10 AM
I saw this script: http://www.dynamicdrive.com/dynamicindex17/stayontop.htm but it uses jquery and I would rather have the javascript on my site as opposed to someone else's.
Is there a way I can have an absolutely positioned div that is "always on top" for that page using javascript as opposed to jquery?
james438
06-06-2011, 08:41 AM
I am probably going to use http://www.dynamicdrive.com/dynamicindex11/colorjack/index.htm for now as it does what I am looking for although it is not precisely what I was originally requesting.
djr33
06-06-2011, 07:35 PM
Jquery can be on your site. It's an open source (well, it's JS, so that's required) script that you upload to your site and use. The only downside is that it's not a small file so it will take bandwidth for some features you don't need. The other problem is that you have to learn new syntax for it, but it's not too hard, especially if you're using existing scripts.
But I understand the desire to have a separate, simpler JS file.
Note also that Jquery is JavaScript-- it's just a set of shortcuts basically.
james438
06-06-2011, 09:32 PM
My understanding of jquery is that it is a javascript script, which is utilized by people who wish to code in a simpler manner. That's fine, but it looks somewhat bulky and when I went to the jquery site it looked like I needed an API key to use it. I could be misunderstanding though.
I can use jquery, but I was hoping for something a bit more independent and simpler. Yep, I mostly just repeated what you already said.
djr33
06-07-2011, 04:30 AM
I don't believe there's any API key or anything like that. You can just download it here I think: http://jquery.com/
And if not, there are lots of versions floating around the internet.
Then just include it as a normal .js file in any page you'd like and it'll work with what you need.
Of course if you don't need Jquery there's no reason to use it and it will be a bit bulky, but at the same time it doesn't really hurt anything. It's just an extra .js file to load.
One note: there are many versions of Jquery, so be aware of which you want to use. Some scripts may rely on or work better with an older version (including possibly some of the scripts here on DD) rather than the newest release. And don't use two different version in the same page or there will be conflicts.
But it sounds like you've solved this. I don't have a better answer. You can do what you're saying with just CSS, though it's very limited... position:fixed;
james438
06-08-2011, 05:38 AM
I should mention that I just found a dd script that does what I was originally looking for http://www.dynamicdrive.com/dynamicindex17/dockcontent.htm. I am using it now.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.