Results 1 to 2 of 2

Thread: ddimgtooltip2.js, line 31 character 4 BUG ?

  1. #1
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default ddimgtooltip2.js, line 31 character 4 BUG ?

    1) Script Title: ddimgtooltipII

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...agetooltip.htm

    3) Describe problem:
    SCRIPT5007: Unable to get value of the property '0': object is null or undefined
    ddimgtooltip2.js, line 31 character 4

    Code:
    /* Image w/ description tooltip v2.0
    * Created: April 23rd, 2010. This notice must stay intact for usage 
    * Author: Dynamic Drive at http://www.dynamicdrive.com/
    * Visit http://www.dynamicdrive.com/ for full source code
    */
    
    var ddimgtooltip={
    
    	tiparray:function(){
    		var tooltips=[]
    		//define each tooltip below: tooltip[inc]=['path_to_image', 'optional desc', optional_CSS_object]
    		//For desc parameter, backslash any special characters inside your text such as apotrophes ('). Example: "I\'m the king of the world"
    		//For CSS object, follow the syntax: {property1:"cssvalue1", property2:"cssvalue2", etc}
    
    
    tooltips[29]=["../jpg/Paradise2.jpg"]
    
    
    		return tooltips //do not remove/change this line
    	}(),
    
    	tooltipoffsets: [20, -30], //additional x and y offset from mouse cursor for tooltips
    
    	//***** NO NEED TO EDIT BEYOND HERE
    
    	tipprefix: 'imgtip', //tooltip ID prefixes
    
    	createtip:function($, tipid, tipinfo){
    		if ($('#'+tipid).length==0){ //if this tooltip doesn't exist yet
    /*LINE 31 ->*/		return $('<div id="' + tipid + '" class="ddimgtooltip" />').html(
    				'<div style="text-align:center"><img src="' + tipinfo[0] + '" /></div>'
    				+ ((tipinfo[1])? '<div style="text-align:left; margin-top:5px">'+tipinfo[1]+'</div>' : '')
    				)
    			.css(tipinfo[2] || {})
    			.appendTo(document.body)
    		}
    		return null
    Last edited by jscheuer1; 05-25-2012 at 05:02 AM. Reason: Format

  2. #2
    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

    You must number the tooltips in sequence starting with 0.
    - John
    ________________________

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

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
  •