Swap Image With A 1px Border?

Apr 3, 2011

Below is the routine I am using that when invoked swaps images for other images:

<script>
function swapImage(swapContName) {
if (swapContName == 'mainImage1') {

[code]....

But one of the images I would like to vanish (using the empty spacer.gif) has a border:

<img id="instructflag" border="1" src="FLAG.gif" width="23" height="15" align="left">

It must have this black border, but when it gets swapped for a blank, I am left with the black square. how to vanish the border along with the graphic?(I have some vague idea that "border" is not used any more, but anyway...).

View 3 Replies


ADVERTISEMENT

Identifying Elements That Call A Function - Change The Border Of Several Images On The Page To Show A 4px Border

Feb 26, 2009

What I want to do is change the border of several images on the page to show a 4px border. There are many images on the page so I just want to call the changeborder() function on the onClick event so as the image that has been clicked changes. However, I don't think using this.style.border to identify the element works when placed within the function. That is, how do I identify, from the function, which image has been clicked? My current code (which does not work) looks like this but I am sure its possible to gather what i'm trying to achieve:

<script type="text/javascript">
function changeborder()
{
this.style.border='4px solid red'
}
</script>
<img style="border: 1px solid #F4F4F4;" onclick="changeborder()" src="images/colours/010.jpg" border="0">

View 1 Replies View Related

Border Around Image

Jul 23, 2005

When I use this code....

window.open('gallery/pic1.jpg','windowname','width=775,height=550,resiz able=yes,scrollbars=yes,top=10,left=10');

....my web page displays a picture with a white border around it. Is there a
way to get rid of the white border? I want to continue to link directly to
my image (pic1.jpg) and not to an HTML page. The reason for this is because
if I link directly to an HTML page then I seem to have problems with pop-up
blockers.

View 1 Replies View Related

Repeat Image For Border

Mar 11, 2007

Can someone point me to some resources on how to tile an image to create a
border?

<td><img src="images/MTile.png" width="1" height="30" alt=""></td>

I have something like that where I need to repeat x times where x depends on
the width of the browser. (Not sure if its a good idea to use a bitmap of
width 1 but I could use one that is larger and then use both(e.g., maybe one
that is 10 pixels wide and repeat that as needed and let the 1 pixel wide
one get the rest(I have some "ends" on the border that I need to display too
so it sorta needs to be exact))

Not sure how to do this with js(just learning it) but obviously I just need
to get the width of the border and then figure out how many times I need to
repeat the code.

I have several issues I am wondering about though. First off is that I have
used photoshop imageready to create a roll over menu bar but in firefox when
I use the down state it leaves a selection rectangle around the image but in
IE it does not do this. It does not look nice in firefox and I'm sure there
is some way to prevent it. (for some reason it selects it when you click the
menu item and this probably can be turned off using css?)

Another issue, which isn't a big deal, is that I'm using symmetric bitmaps
to "cap" the border. I was wondering if it is possible to flip the image
using html or js so that I don't have to have a seperate image for it?

View 7 Replies View Related

Detect If Mouse Is Over The Border Table And Over Cell Border?

Jan 7, 2009

is there a way how to detect if mouse is over the border table and over cell border? and if yes, when user click and host button and move mouse cursor (to increase cell width) which event should i detect ?

View 1 Replies View Related

Swap URL On Image Swap

Mar 28, 2011

I am a complete novice with Javascript, but am trying to work out how I can get a button to swap to another image when clicked, and each image have a different URL attached. I want to use this to toggle the bgcolor of my page using this script:

Code:
<script type="text/javascript">
<!--
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
[Code]...

View 1 Replies View Related

Way To Change Border Of Image On OnClick

Jun 3, 2011

I am trying to add a border around the base they select and then when they select another one, I want the previous one to go away and then high light that one.This is my PHP code that outputs the bases:

$gender = $_GET['gender'];
// SQL Injection here?
$sql = "SELECT * FROM habases WHERE gender='".$gender."'";

[code]....

View 5 Replies View Related

How To Change Border Around Image Rotation

Jan 11, 2011

I am making a website and I have image rotation written in javascript and atm I am trying to change the boarder around my image rotation because right now the boarder is purple but nothing I do seams to work so. Here is my code
<a href="Page2.html"><img id="r1" src="images/Pro-Tech Antivirus Cover.jpg" alt="" border="5"></a>
Its all defined and everything I just need to no how to change the border so its not purple. I want it to be dark cyan?

View 7 Replies View Related

Strange Border Appears In Js Image Flip

Jul 3, 2003

I'm creating a tabbed menu navigation for a site. I'm using javascript to to give the tabs a mouseover effect. I also have a function that decides whether the tab has been selected or deselected by the user, and uses that info to determine which image file to use in the img swap.

The page works fine in IE 6, however in Netscape 6.2, when I mouseover the tabs, a thin border quickly flashes around each image as it swaps. It looks like the placeholder that's displayed for a broken image in IE, only with only the border and no red "x". I'm not sure why this is happening, as all the images have been preloaded.

The markup is XHTML 1.0 Transitional. Here's the js I'm using:

View 1 Replies View Related

Nesting Onclick Image Swap Events And Image Mapping

Jul 24, 2009

I am trying to make a point and click javascript game. Basically what I want is to have one image displayed on screen at the start (room1.jpg). When you click on a door on that image, I have an onclick event to change the image to a new one that shows the door open (room1_a.jpg). What I want is that when you click the now open door, to display the next room in the game. The only solution I can think of is some sort of nested onclick event using several image maps, but I am fairly new to Javascript and I am not sure if that is possible. What it all comes down to is I want to display each incarnation of each room in the game in the same window without having to reload a new window for each room. I hope that makes sense, if not I can try and clarify. Below is the code I have so far. And as you can see all that does is display the open door when you click on the image. I have not done any of the image mapping yet.

[Code]...

View 2 Replies View Related

Image Swap - Thumbnail The Larger Image Will Go Into The Viewing Area

Jan 14, 2009

I am trying to put together a purse shopping site - I would like to have the various views of the same purse in thumbnails under one image then when the customer clicks on the thumbnail the larger image will go into the viewing area. The general layout is like this page - [URL] So when someone clicks on the smallest image I would like it to replace the other image on the page and the larger image becomes the thumbnail. How is this accomplished?

View 2 Replies View Related

Image Swap OnClick Opens Image In Parent Window

Jul 26, 2010

I'm trying to use javascript to load an image on a webpage when another image is clicked on, just like an image gallery and just like this except I don't need any text: [URL] I copied the example above but when I click on the smaller image to load the larger one it works for a fraction of a second (I can see the image load in the right spot), but then the browser goes to the URL of the image instead (showing it on a blank page).

[Code]....

View 13 Replies View Related

Highlight Image - Click On Another Row The First Border That Changed Obviously Changes Back

Aug 27, 2010

I have say 12 pics on a page, in 3 rows of 4. The rows of pics are there so that a choice can be made from each row and I'm using a function <script>

var highlight_color = '#FF0033'; function toggle_highlight(id) { var images = document.getElementsByTagName('img'); for (var i = 0; i < images.length; i++) { var image = images[i]; image.style.borderColor = image.id == id ? highlight_color : 'white'; } } </script>

to toggle a border colour change so that you can see what was chosen from each row. The function I have used is fine in that it works, but I can only choose one picture and have the border changed, then if I click on another row the first border that changed obviously changes back and the new selection is highlighted. I don't really know where to go from here.

View 2 Replies View Related

Text Swap - Change Each Image To Different Image On Mouseover

Jun 15, 2010

I'm failing to get a pure CSS way to achieve this, so trying JS. Several small images in a row, each different. Want mouseover to:

1. change each image to different image on mouseover (each image has its own mouseover image version).

2. produce different paragraph of text below row of images on each mouseover.

I can achieve it with mouseover on text links or on an image, but not with the two events, viz mouseover image swap + mouseover text swap. Would also want to be able to style the text.

View 4 Replies View Related

Swap Image On Click Then Resets When Selecting Next Image

Jan 14, 2010

I have four links that use graphics to create an unvisited and visited state (using CSS). The link actually changes a section of text elsewhere on that page, so the user doesn't leave the page. The clicked, visited graphic reflects what text you are reading. You can then select a different link, and new text reflects the link you clicked on. What goes wrong is that if you click all four links, you eventually get all four visited graphics showing.

What I want is this. You click on the graphic and the graphic changes to visited. You then select a different link and that state goes to visited but the previous link that is visited too, changes back to unvisited. Therefore when you click on any link, that visited state is shown, and all others always reset to unvisited. The results is that the visited graphic reflects the current text on that page.

View 5 Replies View Related

Image Swap

Nov 17, 2007

I am looking to find a javascript that image swaps 4 button images that are to be used as links.

There will be an unvisited button (color of my choice)

There will be a hover state which Is green.

There will be a visited link button that is purple.

There will be a currently active page button that will be red.

I have a script that works for 3 of the for states.
The script that I have also will not keep the purple, visited state, as standard text based links will when a page has allready been visited.
Does anyone have a script that will work for what I want to do for all states.

I don't know how to build a script of my own, but plan on learning.

Does anyone have a script that will work for what I want to do for all 4 link/swap states that I want incorporated?

View 7 Replies View Related

Image Swap - Capturing File Name Rather Than The Entire Path Of The SRC On Input Type="image"

Sep 7, 2010

capturing just the file name rather than the entire path of the SRC on my input type="image". Basically when I hover over an image, the Default Image should change to the image being hovered on. Here is my code, can't quite get it to work. Sorry I'm very new to JavaScript

<html>
<head>
<script language = "Javascript">
function ChangeDefault(src)
{
//document.frmMain.DefaultImage.src = src <--Doesn't work at all
alert(src) //<---Displays the entire file path, want just file name
[Code]...

View 3 Replies View Related

Image Swap - Get Replaced With A New Image

Dec 14, 2010

Lets say I have two images in a box

<body>
<div id="box">
<img src="image1.jpg" id="image1" width="100" height="100" />
<img src="image2.jpg" id="image2" width="100" height="100" />
</div>
</body>

When I click on Image1 I want Image2 to get replaced with a new image, called Image3. So I tried this code:

[Code]...

But instead of replacing the image on click, from some reason it replaces image2 with image3 from start/load.

View 2 Replies View Related

Swap Image Does Not Work With IE

Jul 23, 2005

I tried a Javascript on my homepage that works fine on Netscape, works
nearlyx normal on Opera but does not work at all on Internet Explorer. Is
there anybody out there who can help? I use a frameset of 3 frames. One of
these Frames has thumbnails with the javascript code for the image-swap -
the big picture should change whenever someone clicks on the corresponding
thumb. Code:

View 3 Replies View Related

Image Swap + Restore + Set

Jul 23, 2005

I'm looking for a solution that can be used in a calendar/gig guide
scenario where each day is represented by a dot image. Now this dot must
do the following

1. When the mouse goes over the dot image it swaps to the mouseover dot

2. When the mouse goes out of the dot image it restores back to the
original img

3. When the img is clicked the dot image is swapped with another image
(different to the other 2) that will remain there even when the mouse
goes out of the image

View 2 Replies View Related

Image Swap Only Works In IE

Mar 5, 2006

I have a portfolio page which loads a dozen thumbnails and one large image.
A friend helped me code a script (below) which will swap out the large image
(named "imgLarg") when a different thumbnail is clicked. Both the thumbnail
and the enlargement are identically named, one is in /thumbs/ and one is in
/enlargements/ - tricky, huh? ;-) What's the easiest way to make this work
in other browsers as well?

<script language="JavaScript">
function enlarge() {
oSrcElem = event.srcElement;
imgLarge.src = oSrcElem.src.replace(/thumbs/,'images');
}
</script>

View 12 Replies View Related

How To Swap - Resize Image

Apr 5, 2011

how to veiw this eval's out put?

function doButtons(picimage) {
eval("document['picture'].src = " + picimage + ".src");
}
<?php
// to change the image size within the web page
function imageResize($width, $height, $target) {
//takes the larger size of the width and height and applies the formula accordingly...
//this is so this script will work dynamically with any size image
[Code]....

View 3 Replies View Related

Onclick Image Swap

Jul 3, 2006

Just want to swap an image (thumb) for a larger one - in the same spot - then click on the large image and go back to the small one.

Nothing I have tried works but I KNOW it can be done - can't it?

View 10 Replies View Related

Image Swap On Rollover?

Apr 6, 2008

The problem i'm having is simply getting an image to swap on a mouseover. Well I sort of had it working but then I cahnged the function to try and accomodate for more images and it just fell over dead.

Let me show you the function I have for it. Bear in mind I'm used to coding but more PHP and VB rather than JavaScript

<script language="javascript1.5">
Rollimage = new Array()
Rollimage[0] = new Image(244,244)
Rollimage[0].src = "images/personal_up.png"

[Code]....

BTW I have searched google and read many articles on this but still can't get it to work. Also I have searched previous articles on DaniWeb and again none solve the problem.

The address of the page is [URL]

View 9 Replies View Related

Swap Colours In An Image?

Jun 14, 2010

A client has approached me to build a website which allows visitors to display a rug, select different parts of the rug and change it's colour.I've come across a website that does exactly this, it displays a photo of the rug, you select a colour and then click the part of the image you want to be that colour, and it changes it.

Does anyone know how 1) to pick a colour from an image, and then to 2) change it. Is this possible with javascript, or will I need to use javascript to select the colour from the image, and then some server side PHP to manipulate and reload the image?

View 4 Replies View Related

Image Swap On Toggle

Dec 2, 2003

I've got the toggle part of this file down across multiple browsers, but now I'm hoping someone can help me with making each link an image swap onClick. Code:

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved