Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-20-2010, 10:06 PM   PM User | #1
gerhardtdesign
New to the CF scene

 
Join Date: Aug 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
gerhardtdesign is an unknown quantity at this point
Removing Image Borders with Javascript

Hey all,

Right now I have a website I am working on, dollarwisepromos.com, and I am working on an image rollover script.

If you visit the link: http://www.dollarwisepromos.com/inde...detail&p=33137

You will see the four images beneath the main image and it has a black border around them. I cannot find the code that sets that border.

I'm not sure if it is a PHP issue or a javascript issue, but I'm thinking its a javascript issue.

plugin_rollover_images.html
Code:
<script type="text/javascript" language="JavaScript">
<!-- //
	Default = new Image();
	Default.src = "$additional[default]";
	$additional[preload]
	
	function ImageRollOver (dir, id) {
		if	(dir == 'on') { 
			document.images.detail_image.src = eval("Image"+id+".src");
			document.images.detail_image.width = eval("Image"+id+".width");
			document.images.detail_image.height = eval("Image"+id+".height");
		} else if (dir == 'off') { 
			document.images.detail_image.src = Default.src; 
			document.images.detail_image.width = Default.width;
			document.images.detail_image.height = Default.height;
		}
	}
//-->
</script>

<table style="border-color:#ffffff;" border="0" cellspacing="0" cellpadding="1">
	<tr>
		$additional[data]
	</tr>
</table>
plugin_rollover_images.php
Code:
<?PHP
/*
  include/plugins/plugin_rollover_images.php - 10/02/2009 - 8:24pm PST - 4.2.1
  
  SunShop Shopping Cart
  http://www.turnkeywebtools.com/sunshop/
  
  Copyright (c) 2001-2009 Turnkey Web Tools, Inc.
*/

if (!defined('SS_SESSION_START')) {  
	$abs_path = dirname(dirname(dirname(__FILE__)));
	include_once $abs_path."/global.php";
}

$ADDON_NAME 	= "Product Detail Rollover Images";
$ADDON_VERSION 	= "1.0";
$CLASS_NAME 	= "rollover_images";

class rollover_images {
	var $output;
	
	function rollover_images ($class_vars) {
		$this->class_vars = $class_vars;
	}
	
	function render () {
		global $DB_site, $dbprefix, $settings, $lang, $abs_path;
		$additional = array(); $num = 1;
		$default = $DB_site->query_first("SELECT * FROM `".$dbprefix."products` WHERE `id`='".$_GET[p]."'");
		$additional['default'] = $settings[productpath].$default[detail_image];
		
		$items = $DB_site->query("SELECT * FROM `".$dbprefix."products_images` WHERE `productid`='".$_GET[p]."'");
		while ($image = $DB_site->fetch_assoc($items)) {
			include_once $abs_path."/include/classes/class.imageresize.php";
			$simulate = new image_resize();
			$simulate->resize($abs_path.'/'.$settings[productpath].$image[large_image], $settings['auto_detail_height'], $settings['auto_detail_width'], false);
			
			$additional[preload] .= 'Image'.$image[id].' = new Image('.$simulate->rdata[new_w].','.$simulate->rdata[new_h].');'."\n".'Image'.$image[id].'.src = "'.$settings[shopurl].'include/plugins/plugin_rollover_images.php?img='.$image[id].'&w='.$settings['auto_detail_width'].'&h='.$settings['auto_detail_height'].'"'."\n";
			$additional[data] .= template('plugin_rollover_images_item.html', array('image' => array('product' => $_GET[p], 'location' => $settings[shopurl].'include/plugins/plugin_rollover_images.php?img='.$image[id].'&amp;w='.$this->class_vars[max_width].'&amp;h='.$this->class_vars[max_height], 'size' => '', 'id' => $image[id])));
			
			if ($num == $this->class_vars[number]) { $additional[data] .= "\n</tr><tr>\n"; $num = 1; } else $num++;
		}
		
		return template('plugin_rollover_images.html', array('additional' => $additional));
	}
	
	function install () {
		global $DB_site, $dbprefix;
		$DB_site->query("INSERT INTO ".$dbprefix."modules_plugins set `module`='rollover_images', `internalname`='enabled', `name`='Enabled', `moptions`='', `options`='0::1->Off::On', `value`='1', `help`='', `size`='0', `dorder`='1', `field_type`='dropdown'");
		$DB_site->query("INSERT INTO ".$dbprefix."modules_plugins set `module`='rollover_images', `internalname`='number', `name`='Images Per Row', `moptions`='', `options`='', `value`='3', `help`='', `size`='3', `dorder`='2', `field_type`='textbox'");
		$DB_site->query("INSERT INTO ".$dbprefix."modules_plugins set `module`='rollover_images', `internalname`='max_width', `name`='Maximum Thumb Width', `moptions`='', `options`='', `value`='75', `help`='', `size`='3', `dorder`='3', `field_type`='textbox'");
		$DB_site->query("INSERT INTO ".$dbprefix."modules_plugins set `module`='rollover_images', `internalname`='max_height', `name`='Maximum Thumb Height', `moptions`='', `options`='', `value`='75', `help`='', `size`='3', `dorder`='4', `field_type`='textbox'");
	}
	
	function uninstall () {
		global $DB_site, $dbprefix;
		$DB_site->query("DELETE FROM ".$dbprefix."modules_plugins where `module`='rollover_images'");
	}
}

if (is_numeric($_GET[img]) && is_numeric($_GET[w]) && is_numeric($_GET[h])) {
	$image = $DB_site->query_first("SELECT * FROM `".$dbprefix."products_images` WHERE `id`='".$_GET[img]."'");
	include_once $abs_path."/include/classes/class.imageresize.php";
	$resize = new image_resize();
	$resize->resize_and_display($abs_path.'/'.$settings[productpath].$image[large_image], $_GET['h'], $_GET['w']);
	exit;
} 
?>
gerhardtdesign is offline   Reply With Quote
Old 08-20-2010, 10:18 PM   PM User | #2
jolly_nikki
New Coder

 
Join Date: Aug 2009
Posts: 94
Thanks: 0
Thanked 16 Times in 16 Posts
jolly_nikki is on a distinguished road
This the image tag that you have

Code:
<img border="0" alt="" style="border: 1px solid rgb(0, 0, 0);" src="http://www.dollarwisepromos.com/include/plugins/plugin_rollover_images.php?img=18&amp;w=75&amp;h=75">
You have attribute given border as 1px solid. Remove it


Code:
<img border="0" alt=""  src="http://www.dollarwisepromos.com/include/plugins/plugin_rollover_images.php?img=18&amp;w=75&amp;h=75">
jolly_nikki is offline   Reply With Quote
Old 08-23-2010, 09:28 PM   PM User | #3
gerhardtdesign
New to the CF scene

 
Join Date: Aug 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
gerhardtdesign is an unknown quantity at this point
Quote:
Originally Posted by jolly_nikki View Post
This the image tag that you have

Code:
<img border="0" alt="" style="border: 1px solid rgb(0, 0, 0);" src="http://www.dollarwisepromos.com/include/plugins/plugin_rollover_images.php?img=18&amp;w=75&amp;h=75">
You have attribute given border as 1px solid. Remove it


Code:
<img border="0" alt=""  src="http://www.dollarwisepromos.com/include/plugins/plugin_rollover_images.php?img=18&amp;w=75&amp;h=75">
Where are you seeing this code? It's not in any of the code I posted.
gerhardtdesign is offline   Reply With Quote
Old 08-23-2010, 11:14 PM   PM User | #4
low tech
Regular Coder

 
low tech's Avatar
 
Join Date: Dec 2009
Posts: 740
Thanks: 149
Thanked 67 Times in 67 Posts
low tech is on a distinguished road
It's in your HTML, in your table where your images are placed.
low tech is offline   Reply With Quote
Old 08-23-2010, 11:15 PM   PM User | #5
gerhardtdesign
New to the CF scene

 
Join Date: Aug 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
gerhardtdesign is an unknown quantity at this point
That code is dynamically generated somehow, I cannot find that that anywhere in the source code.
gerhardtdesign is offline   Reply With Quote
Old 08-24-2010, 03:27 AM   PM User | #6
rettgoings
New Coder

 
Join Date: Jul 2010
Posts: 37
Thanks: 17
Thanked 0 Times in 0 Posts
rettgoings is an unknown quantity at this point
Do you have a web editor like Dreamweaver? If so just CTRL+F search your source code in all local file copies for all instances of "1px solid". Something has to putting it there.

Last edited by rettgoings; 08-24-2010 at 03:30 AM..
rettgoings is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:09 PM.


Advertisement
Log in to turn off these ads.