Results 1 to 6 of 6

Thread: always on top div

  1. #1
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default always on top div

    I saw this script: http://www.dynamicdrive.com/dynamici.../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?
    Last edited by james438; 06-08-2011 at 05:38 AM.
    To choose the lesser of two evils is still to choose evil. My personal site

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    I am probably going to use http://www.dynamicdrive.com/dynamici...jack/index.htm for now as it does what I am looking for although it is not precisely what I was originally requesting.
    To choose the lesser of two evils is still to choose evil. My personal site

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    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.
    To choose the lesser of two evils is still to choose evil. My personal site

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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;
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    I should mention that I just found a dd script that does what I was originally looking for http://www.dynamicdrive.com/dynamici...ockcontent.htm. I am using it now.
    To choose the lesser of two evils is still to choose evil. My personal site

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •