PDA

View Full Version : Removing Image Borders with Javascript



gerhardtdesign
08-20-2010, 11:06 PM
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/index.php?l=product_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


<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


<?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;
}
?>

jolly_nikki
08-20-2010, 11:18 PM
This the image tag that you have


<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



<img border="0" alt="" src="http://www.dollarwisepromos.com/include/plugins/plugin_rollover_images.php?img=18&amp;w=75&amp;h=75">

gerhardtdesign
08-23-2010, 10:28 PM
This the image tag that you have


<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



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

low tech
08-24-2010, 12:14 AM
It's in your HTML, in your table where your images are placed.

gerhardtdesign
08-24-2010, 12:15 AM
That code is dynamically generated somehow, I cannot find that that anywhere in the source code.

rettgoings
08-24-2010, 04:27 AM
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.