SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Moving layers with the mouse...

    I have the following script for a Layer popup, so my visitors can get help for particular words.
    PHP Code:
    var oldX oldY 0

    function 
    scrollDiv(divID) { 
        var 
    yHome xHome 100
        var 
    yPos = (document.all || document.getElementById) ? document.body.scrollTop window.pageYOffset
        var 
    xPos = (document.all || document.getElementById) ? document.body.scrollLeft window.pageXOffset
        
        var 
    divStyle = (document.getElementById) ? document.getElementById(divID).style : ( (document.all) ? document.all[divID].style document.layers[divID] ); 
        
        if (
    'note'.indexOf(divID.substr(0,3)) != -1

        
    oldY resetXY(divStylefalseyPosyHome

        else { 
            if (
    yPos != oldYoldY resetXY(divStylefalseyPosyHome
            if (
    xPos != oldXoldX resetXY(divStyletruexPosxHome
        } 

        
    function 
    resetXY(divObjisXxyValxyOffset) { 
        if (
    isXdivObj.left xyOffset xyVal
        else 
    divObj.top xyOffset xyVal
        
        return (
    xyVal); 

        
    function 
    init(divID){ 
        
    scrollDiv(divID); 
        
    setTimeout("init('"divID "')"5); 

        
        
    function 
    doSel(selObj){ 
        for (
    i=0iselObj.lengthi++) 
        if (
    selObj.options[i].selected
        eval(
    selObj.options[i].value

        
    function 
    changeVis(divID,isShow){ 
        
    divStyle = (document.layers) ? document.layers[divID] : ( (document.getElementById)? document.getElementById(divID).style document.all[divID].style ); 
        
    divStyle.visibility = (isShow) ? 'visible' : ( (document.layers) ? 'hide' 'hidden'); 

    (Thanks to Vinny for the code)

    Is it Possible to allow the visitor to move the Layer with his/her mouse???
    And if so: can the script remember this location and popup the next Layers there as well?

    Any help will be appreciated!

    Jazz
    Last edited by jazztie; Oct 29, 2001 at 05:59.

  2. #2
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No one???
    Please?

    Jazz


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
  •