Results 1 to 7 of 7

Thread: top floating layer

  1. #1
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default top floating layer

    http://www.echoecho.com/toolfloatinglayer.htm

    how can save it to a .js file and using in the webpage??

    thanks a lot

  2. #2
    Join Date
    Dec 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by share
    http://www.echoecho.com/toolfloatinglayer.htm

    how can save it to a .js file and using in the webpage??

    thanks a lot
    Just follow his instructions. The first portion goes in the head section of your page. The second portion goes at the bottom of the page, just above the </body> tag. Then, modify this last piece as described, replacing
    ***** ENTER THE CONTENT FOR YOUR LAYER HERE *****
    with whatever HTML you would like to see floating on your page.

    Make certain that you try this on a page with more than a page worth of text or you won't see it scroll. Also, change the halign and valign settings at the top of the script to either left and top or right and top.

  3. #3
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry,i know how to use,but i want to save it as a .js file for different pages,not for single page

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Since this effect relies upon three separate scripts, each one must be saved to an external .js file and then each one called from the appropriate spot on the page(s) where you want to make use of them. That spot is the spot where they would have been if written out on (each of) the page(s).

    Here are my general guidelines on external scripts, not all of which may apply in this particular case:

    Use a text editor to save the script, call it 'file_name.js' where 'file_name' can be any valid file name of your choosing. Substitute the name of your external .js file for some.js in the below:

    HTML Code:
    <script src="some.js" type="text/javascript"></script>
    Common problems arise when:

    1 ) The script file is not in the directory specified. In the above example it must be in the same directory as the page(s) that use it. Below, it can be in the scripts directory off of the root of a domain:

    HTML Code:
    <script src="http://www.somedomain.com/scripts/some.js" type="text/javascript"></script>
    2 ) Opening, closing and/or 'hiding' tags are left in the external file. This means that you must strip:
    Code:
    <script>
    <!--
    and
    Code:
    //-->
    </script>
    and any of their many variations from the beginning and end of the external file.

    3 ) The external call (<script src="some.js" type="text/javascript"></script>) is not inserted into the page at the correct spot. The external call must be inserted at the same place on the page where the script was/would have been.

    4 ) Paths to other files (if) used by the script are no longer valid due to its location. This is only a problem if the external script is kept in a different directory than the page it was working on when it was an internal script. To correct this, use absolute paths inside the script. Absolute path examples:

    Code:
    http://www.somedomain.com/images/button.gif
    
    http://www.somedomain.com/~mysitename/index.html
    5 ) Inappropriately combining two or more scripts into one external file. Usually external scripts can be combined if one knows enough about scripting to do so properly. Even then it is possible to overlook something.

    A rule of thumb when testing is, if it won't work on the page, it won't work as an external file either.

    One other thing, if this is a DD script or any script that requires the credit remain for legal use, include the credit in the on page call, ex:

    HTML Code:
    <script src="some.js" type="text/javascript">
    /***********************************************
    * IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
    * Visit DynamicDrive.com for hundreds of original DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    </script>
    Make sure to retain all the 'decorations', as these include begin and end javascript comment delimiters without which the script won't function.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    that mean copy all code to the .js file and del <script></script<..and //..>??
    because i copy all code to the .js ,it's can't work
    Last edited by share; 01-10-2006 at 01:01 PM.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by share
    that mean copy all code to the .js file and del <script></script<..and //..>??
    because i copy all code to the .js ,it's can't work
    How many .js files did you make? What does the code look like on the page where you are using the external files? Was it working on the page before you made it external?

    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    there are different link in each page.Thus,i want to use an external .js file, easy to edit.
    the webpage is just design now.If it's impossible to make an external .js flie, i will copy the js code to the html. Thank you very much jscheuer1
    I am just a starter and wasting your time, sorry

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
  •