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


ADVERTISEMENT

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

Border Around An Object - Change The Background Colour And Font Colour Of Some Elements

Sep 22, 2009

I am using javascript code to change the background colour and font colour of some elements called 'filled') dynamically. For example:

if(timeInputValue >= startcode && timeInputValue < endcode && stateInput.value == "playing") {
filled.style.backgroundColor = '#ffffff';
filled.style.color = '#000000';
}

I also want to put a border around these 'filled' elements too - how can I do this is javascript? I can't find an equivelent to style.border = "1px"

View 1 Replies View Related

Give - Space Between Scrolling Images And Border For The Images

Sep 1, 2010

I am trying scrolling of images as like: [url]. I do want to set border for the images with border property as "2px solid #000" and i do want gap between the images so that the horizontal gap value is 20px.

I tried even with image border propoerty and image style properties both border and padding as 0 20px. Both not working properly. The style padding property is working fine in firefox and google chrome. But it is working in IE 6.0

I'll paste my code for your reference.

View 1 Replies View Related

JQuery :: Border Around Fisheye Images

Jun 28, 2009

I have a couple of images in a fisheye that I want to be displayed with some space between them. Currently, jQuery displays the images directly connected to each other:

[Code]...

View 5 Replies View Related

Code For No Border For Linked Images?

Feb 3, 2010

I found a great piece of Javascript on this forum for linked random images with rollover effect but I can't figure out how to add "no border" to the script as I do not want to have a border around the linked images.

[Code]...

View 4 Replies View Related

Call Script Event On HTML Div Border Corners?

Jun 19, 2011

It sounds confusing, but is quite simple. I have a square div, and using css I have four circles replacing the corners of the of the divs border. I want the user to be able to click on one of the corner circles changing the curser image and calling the Javascript onclick event. How do I did that?

View 6 Replies View Related

Change Link Border With Js?

Aug 26, 2009

I need to set the border width of a link when it is clicked. The link calls a javascript and so I need a way to identify which link has been clicked, hence the outline...i tried this.style.borderWidth = 'thin';but to no avail...?!I have already assigned border-color and border-style in the style sheet if that makes any difference...

View 1 Replies View Related

Change Border Property By ID

Feb 6, 2006

I am working on creating a simple image gallery. I have added styling around the thumbnail images (border and padding). I would like to change the border color when the item is hovered over. I know this can be done rather easily with the getElementById command. Can someone help me understand this process? Here's a snippet of the list that I am working with...

Here's the CSS:

ul {
padding:0;
margin:0;
position:relative;
}
li {
float:left;
padding:0 .5em .3em .5em;
list-style:none;
}
#gallery {
list-style:none;
}
#gallery li {
display:inline;
}
#gallery li a img {
border:1px solid #ccc;
padding:3px;
}

Here's the HTML:

<ul id="gallery">
<li><a href="path/to/image/large/" title="title/of/image/"><img src="path/to/image/thumb/" alt="title/of/image/" /></a></li>
<li><a href="path/to/image/large/" title="title/of/image/"><img src="path/to/image/thumb/" alt="title/of/image/" /></a></li>
<li><a href="path/to/image/large/" title="title/of/image/"><img src="path/to/image/thumb/" alt="title/of/image/" /></a></li>
</ul>
I would like to change the border color from #ccc to #3455ef when the item is hovered over, and ideally have a different style when the item is clicked (or active).

View 3 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

JQuery :: Change All Table Cells To Have A Border?

May 5, 2009

See the table code below. Because this table is created by a third party application, I can't modify their code. So, I'm stuck trying to find other ways to change the table styles. I figured jQuery would be a great way to accomplish this, but I can't figure out the correct code. Can someone show me how to change all cells, or certain cells (dddefault and ddlabel) to have a border? I've gotten close, but it only affects the first cell.

<TABLE CLASS="datadisplaytable" SUMMARY="This layout table is used to present the weekly course schedule." WIDTH="80%">
<TR>
<TH CLASS="ddheader" scope="col" > </TH>
<TH CLASS="ddheader" scope="col" >   Monday   </TH>

[code]....

View 3 Replies View Related

Change Textbox Border Color On Hover?

Sep 27, 2011

sing Javascript, on mouseover/hover, I would like to change the boder color of my textbox from
rgb(142, 142, 142) to black: rgb(0, 0, 0,) then when I move the mouse pointer off the textbox, I would like it to change from black back to rgb(142, 142, 142).I can't figure out where to start or how to get this going.

View 5 Replies View Related

DHTML Change Text,border And Background?

Jul 20, 2010

Below you will find my code for a web program that takes in changes and will change the last area. I am wondering if i need to make the last box a textarea? Also any help with the javascript will be greatly appreciated and any other ways to make it better will be also.

<!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>

[code]....

View 6 Replies View Related

Attempting To Change Border Color And Style Of A Asp.net Text Box?

Mar 16, 2011

am beginner in javascript. I am attempting to change border color and style of a asp.net text box using javascript. The function is inside a .js file. It is as follows.

function checkMoney(controlID)
{
var control = document.getElementById(controlID);

[code]....

View 3 Replies View Related

When I Resize The Page, Drag Its Border Lines And So On, Everything Gets Messed Up?

May 3, 2011

I have with the regions on the page. I would like to know how could I resize them... I know there is no HTML or CSS modality, therefore the only solution has to come from Javascript. Image I have four flags on a page and each of those are links to other pages. However, when I resize the page, drag its border lines and so on, everything gets messed up.how to solve this? Or at least other options, like Tables, Divs, anything that can resize and accept links?

View 8 Replies View Related

JQuery :: Element Overflows Containing Block When Parent Border/padding Change - Not When Parent's Margin Changes

Sep 24, 2011

Demonstration page: [url]

Adjust the CSS margins of the BODY element with the first slider. The yellow P (paragraph) element resizes to fit its smaller containing block, as I would expect.

Then, adjust the CSS border or padding of the BODY element with the second and third sliders. The P element does not resize, though its origin changes. Instead, it overflows its containing block.

Finally, adjust the margins again. The P element snaps back into its containing block.

As you can see from the source, this is jQuery 1.6.4 and jQueryUI 1.8 pulled from googleapis.com.

Edit: Client is Google Chrome16.0.889.0 dev-m.

View 2 Replies View Related

Change Border Of Some Cell By OnMouseOver Different Cell?

Apr 11, 2010

imagine table with 15 rows and 3 columns. If I move mouse over any cell I want some other specific cells to change their borders like with pseudo-class :

example

<style>
.boryellow {border: 3px solid yellow}
.borblue {border: 3px solid black}
</style>

this will work, a cell can change itself

<td name="third" class="boryellow" onmouseover="this.className='borblue'" onmouseout="this.className='boryellow'">cell</td>
even when dealing with empty images - click on link will change border of different element - imgs, but not span or td ...
<a href="#" onclick="document.all.xxx.className='borblue'; document.all['name'].className='borblue';

[code].....

Replacing any element link by "third" or "spanx" will cause stuck ant not executing other actions.

View 4 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

Put A Border Around An Input Box?

Dec 26, 2011

how do i put a red border around an input box with a class of .input1 if it goes into this loop??

if(firstName=='' || firstName.length < 3 || firstName=='First Name:' ){
error = 'Please enter your first name';
$j('#errormsg').html('<p class="errors">'+ error +'</p>');
return false;
}

View 3 Replies View Related

Equiv Of Border=1 In Table

Sep 4, 2006

Wondered if you could let me know if I've missed something when setting up a
table.

If I use the following:

<TABLE WIDTH=500 BORDER=1>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>

All 4 sides of all of 4 table cells have a border 1 pixel in depth -
perfect!

If I change this to:

<TABLE WIDTH=500 STYLE="border: 1px dashed black">
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
<TR><TD>fred</TD></TR>
</TABLE>

I only get a border on the outer 'wall' of the table - no borders on the
cells!!!

Due to the project I'm working on, I'm dynamically creating rows and cols in
DOM, I'd really like to just specify that all of the cols/rows have a border
in one go like the old table method rather than having to define the border
style for each cell.

I can't use the old table method of BORDER=1 because I need the dashed style
rather than a solid border. Any ideas on how I can do this?

View 3 Replies View Related

How To Remove A Border Style Under IE?

Dec 8, 2006

I have the following problem:

An input field get a border assigned by a style class (e.g. 2px solid red).
When the field gets the focus, we set the border to green.

element.style.border = "2px solid green";

When the field looses the focus, the border should change back to red.
We just want to remove the style we have set, when the field has got the
focus, so that the style class is visible again.

element.style.border = "";

Under Firefox that works but not under IE.
We have changed to the class mode, because we don't want to save the
previous setting and restore it later.

Is there a possibility to remove the style (especially the border style)
under IE, so that the style of the assigned class is visible again?

element.style.removeAttribute doesn't seem to work, but may be I make
something wrong? Code:

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

JQuery :: Getting Rid Of Border Around Img Link (IE 8)?

Oct 12, 2011

've been grinding this for days and nothing seems to work. I'm using a JQuery script (or a variant) called the bx.Slider [URL].. It works well. It's all positioned properly. I use my own prev/next images, and there is the ugly blue border around them in IE 8 only. I've tried removing the border, both in the js file (jquery.bxSlider.min.js), in my own syle sheets where you can style the js created classes, or inline, in the tags themselves... None have worked in any way, shape or form.

Maybe I am looking in the wrong places, but I can't seem to find the answer. Does anyone know of a trick or two regarding this?

View 3 Replies View Related

Putting A Border On DOM Tablerow?

Jun 2, 2011

I am using DOM table insertrow as such:

Code:

var _table = document.getElementById("TableList").insertRow(0);
_table.border = 1;
var cell0 = _table.insertCell(0);
var cell1 = _table.insertCell(1);

[Code]....

but it does not seem to work. how to get a border on the individual row?

View 1 Replies View Related

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 View Related







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