Results 1 to 4 of 4

Thread: Static Logo Image fades, but URL remains...

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

    Default Static Logo Image fades, but URL remains...

    Sorry, I have reading fail. Thanks for answering my question even though I posted it in the wrong forum.

    The Site Logo/ Watermark Script is exactly what I need for a site, except for one problem.

    I have utilized the visibleduration and have it fading out after 5 seconds, but the link is still there.

    The beauty of this script is that it gives me a chance to flash a little "ad" but then disappear so the page can be seen as normal, but having that phantom link there messes with other links on the page if they fall into that area.

    Any suggestions? Is there something in this awesome script that I can manipulate to make the URL for the static image disappear along with the graphic itself?

    Code:
    //** Site Logo/ Watermark Script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
    //** Available/ usage terms at http://www.dynamicdrive.com
    //** v2.0 (April 19th, 09')
    
    
    var ddsitelogo={
    	setting: {orientation:3, visibleduration:5000, fadeduration:[1000, 500]}, //orientation=1|2|3|4, duration=millisec or 0, fadedurations=millisecs
    	offsets: {x:10, y:10},//offset of logo relative to window corner
    	logoHTML: '<a href="http://www.xxx" title="..."><img src="http://xxx.gif" style="width:185px; height:217px; border:0" /></a>', //HTML for logo, which is auto wrapped in DIV w/ ID="mysitelogo"
    
    	coord: {},
    
    	keepfixed:function(){
    		if (!this.cssfixedsupport){
    			var $window=jQuery(window)
    			var is1or3=/^[13]$/.test(this.setting.orientation)
    			var is1or2=/^[12]$/.test(this.setting.orientation)
    			var x=$window.scrollLeft() + (is1or3? this.offsets.x : $window.width()-this.$control.width()-this.offsets.x)
    			var y=$window.scrollTop() + (is1or2? this.offsets.y : $window.height()-this.$control.height()-this.offsets.y)
    			this.$control.css({left:x+'px', top:y+'px'})
    		}
    	},
    
    	showlogo:function(){
    		var mainobj=ddsitelogo
    		this.$control.animate({opacity:1}, this.setting.fadeduration[0])
    		if (this.setting.visibleduration>0){
    			setTimeout(function(){
    				mainobj.$control.stop().animate({opacity:0}, mainobj.setting.fadeduration[1], function(){
    					jQuery(window).unbind('scroll.fixed resize.fixed')
    				})
    			}, this.setting.visibleduration+this.setting.fadeduration[0])
    		}
    	},
    	
    	init:function(){
    		jQuery(document).ready(function($){
    			var mainobj=ddsitelogo
    			var iebrws=document.all
    			mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
    			if (mainobj.cssfixedsupport){
    				mainobj.coord[(/^[13]$/.test(mainobj.setting.orientation))? 'left' : 'right']=mainobj.offsets.x
    				mainobj.coord[(/^[12]$/.test(mainobj.setting.orientation))? 'top' : 'bottom']=mainobj.offsets.y
    			}
    			mainobj.$control=$('<div id="mysitelogo">'+mainobj.logoHTML+'</div>')
    				.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', opacity:0})
    				.css(mainobj.coord)
    				.appendTo('body')
    			if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
    				mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
    			mainobj.keepfixed()
    			mainobj.showlogo()
    			$(window).bind('scroll.fixed resize.fixed', function(){mainobj.keepfixed()})
    		})
    	}
    }
    
    ddsitelogo.init()
    Last edited by lilbadger25; 05-20-2010 at 12:15 PM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Try something like this:
    Code:
    //** Site Logo/ Watermark Script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
    //** Available/ usage terms at http://www.dynamicdrive.com
    //** v2.0 (April 19th, 09')
    
    
    var ddsitelogo={
    	setting: {orientation:3, visibleduration:5000, fadeduration:[1000, 500]}, //orientation=1|2|3|4, duration=millisec or 0, fadedurations=millisecs
    	offsets: {x:10, y:10},//offset of logo relative to window corner
    	logoHTML: '<a href="http://www.xxx" title="..."><img src="http://www.google.com/intl/en_ALL/images/srpr/logo1w.png" style="width:185px; height:217px; border:0" /></a>', //HTML for logo, which is auto wrapped in DIV w/ ID="mysitelogo"
    
    	coord: {},
    
    	keepfixed:function(){
    		if (!this.cssfixedsupport){
    			var $window=jQuery(window)
    			var is1or3=/^[13]$/.test(this.setting.orientation)
    			var is1or2=/^[12]$/.test(this.setting.orientation)
    			var x=$window.scrollLeft() + (is1or3? this.offsets.x : $window.width()-this.$control.width()-this.offsets.x)
    			var y=$window.scrollTop() + (is1or2? this.offsets.y : $window.height()-this.$control.height()-this.offsets.y)
    			this.$control.css({left:x+'px', top:y+'px'})
    		}
    	},
    
    	showlogo:function(){
    		var mainobj=ddsitelogo
    		this.$control.animate({opacity:1}, this.setting.fadeduration[0])
    		if (this.setting.visibleduration>0){
    			setTimeout(function(){
    				mainobj.$control.stop().animate({opacity:0}, mainobj.setting.fadeduration[1], function(){
    					jQuery(window).unbind('scroll.fixed resize.fixed')
    					jQuery(this).css("display", "none");
    				})
    			}, this.setting.visibleduration+this.setting.fadeduration[0])
    		}
    	},
    	
    	init:function(){
    		jQuery(document).ready(function($){
    			var mainobj=ddsitelogo
    			var iebrws=document.all
    			mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
    			if (mainobj.cssfixedsupport){
    				mainobj.coord[(/^[13]$/.test(mainobj.setting.orientation))? 'left' : 'right']=mainobj.offsets.x
    				mainobj.coord[(/^[12]$/.test(mainobj.setting.orientation))? 'top' : 'bottom']=mainobj.offsets.y
    			}
    			mainobj.$control=$('<div id="mysitelogo">'+mainobj.logoHTML+'</div>')
    				.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', opacity:0})
    				.css(mainobj.coord)
    				.appendTo('body')
    			if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
    				mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
    			mainobj.keepfixed()
    			mainobj.showlogo()
    			$(window).bind('scroll.fixed resize.fixed', function(){mainobj.keepfixed()})
    		})
    	}
    }
    
    ddsitelogo.init()
    Good luck!
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    lilbadger25 (05-20-2010)

  4. #3
    Join Date
    May 2010
    Location
    Canada
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thanks so much! That was perfect...

  5. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    No problem! Your welcome!
    Jeremy | jfein.net

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
  •