Results 1 to 8 of 8

Thread: add a "close" icon o my static logo script

  1. #1
    Join Date
    May 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question add a "close" icon o my static logo script

    1) Script Title: Site Logo Script (Geocities Watermark)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/logo.htm

    3) Describe problem:
    hello evryone, i have an issue with the site logo script it's that i need to put in the to of the logo a tiny icon of "close" when click on it the logo desepar smoothly down, anf of course the logo stand still without any mouvement until i click on the close icon; here is my staticlogo.js :

    ///////////////////////////////////////////////////////////////////
    /*Site Logo Script (Geocities Watermark)
    © Dynamic Drive (www.dynamicdrive.com)
    For full source code, installation instructions,
    100's more DHTML scripts, and TOS, visit http://www.dynamicdrive.com/ */
    ///////////////////////////////////////////////////////////////////

    //edit the below 5 steps

    // 1) substitute 116 and 42 with the width and height of your logo image, respectively
    var logowidth=500 //
    var logoheight=120 //
    var logoimage=new Image(logowidth,logoheight)

    // 2) change the image path to reflect the path of your logo image
    logoimage.src="alert/bulkdownload.gif" //

    // 3) Change url below to the target URL of the logo
    var logolink="http://www.photobucket.com" //

    // 4) change the alttext variable to reflect the text used for the "alt" attribute of the image tag
    var alttext="Click here"

    // 5) Finally, below variable determines the duration the logo should be visible after loading, in seconds. If you'd like the logo to appear for 20 seconds, for example, enter 20. Entering a value of 0 causes the logo to be perpectually visible.
    //var visibleduration=8 //

    // Optional parameters // image position
    var Hoffset=300 //Enter logo's offset from left edge of window (edit only if you don't like the default offset)
    var Voffset=2 //Enter logo's offset from bottom edge of window (edit only if you don't like the default offset)

    ///////////////////////////Do not edit below this line/////////////////////////

    var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1

    var watermark_obj=ie? document.all.watermarklogo : document.getElementById? document.getElementById("watermarklogo") : document.watermarklogo

    function insertimage(){
    if (ie||document.getElementById)
    watermark_obj.innerHTML='<a href="'+logolink+'" target="_blank"><img src="'+logoimage.src+'" width="'+logowidth+'" height="'+logoheight+'" border=0 alt="'+alttext+'"></a>'
    else if (document.layers){
    watermark_obj.document.write('<a href="'+logolink+'"><img src="'+logoimage.src+'" width="'+logowidth+'" height="'+logoheight+'" border=0 alt="'+alttext+'"></a>')
    watermark_obj.document.close()
    }
    }

    function positionit(){
    var dsocleft=ie? document.body.scrollLeft : pageXOffset
    var dsoctop=ie? document.body.scrollTop : pageYOffset
    var window_height=ie? document.body.clientHeight : window.innerHeight

    if (ie||document.getElementById){
    watermark_obj.style.left=parseInt(dsocleft)+5+Hoffset
    watermark_obj.style.top=parseInt(dsoctop)+parseInt(window_height)-logoheight-Voffset
    }
    else if (document.layers){
    watermark_obj.left=dsocleft+5+Hoffset
    watermark_obj.top=dsoctop+window_height-logoheight-Voffset
    }
    }

    function hidewatermark(){
    if (document.layers)
    watermark_obj.visibility="hide"
    else
    watermark_obj.style.visibility="hidden"
    clearInterval(watermarkinterval)
    }

    function beingwatermark(){
    watermarkinterval=setInterval("positionit()",50)
    insertimage()
    if (visibleduration!=0)
    setTimeout("hidewatermark()",visibleduration*1000)
    }

    if (ie||document.getElementById||document.layers)
    window.onload=beingwatermark

  2. #2
    Join Date
    May 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hello any one !! please

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Sure, try the below modified .js file, which adds a close button to the logo that when clicked on dismisses it. You may want to edit the HTML for the logo inside the .js file:

    Code:
    	logoHTML: '<a href="javascript:ddsitelogo.hidelogo()"><img src="close_1.gif" style="float:right;border-width:0" /></a><a href="http://www.dynamicdrive.com" title="Dynamic Drive"><img src="http://i40.tinypic.com/e7xmvm.gif" style="width:50px; height:47px; border:0" /></a>', //HTML for logo, which is auto wrapped in DIV w/ ID="mysitelogo"
    The part in red defines where the close button appears within the logo.
    DD Admin

  4. The Following User Says Thank You to ddadmin For This Useful Post:

    fidraman (06-07-2010)

  5. #4
    Join Date
    May 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thanks DDADMIN;
    that's seems to work just fine ,but there is a liiitl probleme in the displaying of the logo :
    the photo joined in this rplay explain everything :


    how to resolve that robleme and prevent the second image from appearing.
    thanks a lot, i approciate it

  6. #5
    Join Date
    May 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    and also that heppening jus in IE, but inf firefox another problm is that the closing icon doesnt work when clicking on it. that image don't disepear and i need badly to make it work in teh firefox specialy .

  7. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm i just tested the script in FF3.6, and clicking the close button does close it. Please post a link to the page on your site that contains the problematic script so we can check it out.
    DD Admin

  8. #7
    Join Date
    May 2010
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

  9. #8
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I just viewed your page in FF3.6, and clicking the "x" icon does dismiss the static logo for me. What version of FF are you using?
    DD Admin

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
  •