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:
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);
I made a popup window with createpopup(). The window has a frame border around it that is grey. I can't seem to find the code that would not allow the frame of the popup to show.
I imagine this is trivial - in fact it must have been asked before, I just can't find the answer. I have looked.I have a dotted bottom border defined on my link hovers, like so [code]
i am using the object flash embed instead of the swfobject or flashobject because I am embedding using js innerHTML. Is there a way to loose the dotted border in IE that swfobject fixes? The movie needs no interactivity its just a swf animation.
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:
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 ?
Any way to remove styling on a parent element with JS (as it can't be done in CSS). In a situation like this: Code: <p><img src="image1.gif"></p> <p>Brutus aderat forti.</p> <p><img src="image2.gif"></p> <p>Caesar adsum jam.</p>
The <p> element has default padding, but I'd like to remove the padding when the <p> contains an image. This was my failed attempt to target the <p> element: Code: window.onload = paraPad; function paraPad() { var img = document.getElementsByTagName("img"); var imgpara = img.parentNode; for (i=0; i<imgpara.length; i++) { imgpara.style.padding = "0"; }}
I have many divs with spans inside(just like it is below-no extra ids,classes for spans: [...] <div> <span style="color:red;">a</span> <span style="color:blue;">b</span> <span style="color:white;">c</span> </div> <div> <span style="color:red;">d</span> <span style="color:blue;">a</span> <span style="color:white;">a</span> </div> [...]
What I would like to achieve: user selects with mouse "ab", click button(input type=button) which remove style from selected span/spans. Similar behavior like it is in TinyMCE.
My understanding had been that $.css("width") would return the original user selected style, eg "100%" or "10em", and $.width() returned the computed width, always in "px". Not so, following the code through for .css(), it calls something called getComputedStyle and the only difference between the two functions turns out to be a post-fix of "px" on the .css() result - not very useful. I need to know whether my user has called me with a proportional dimension, or a fixed one. How to tell with jQuery?
This is probably quite a simple problem but I can't figure out the answer. I'm working on a site that has news stories and events coming in. What I would like is to have the news stories to be styled with squares and events with discs for instance. I might be able to change the actual plug-in so the CSS affects this change, but I just wondered how I could change the list-style-type with jQuery.
if I have an html page that uses the <style> or a <link> to call a style sheet these properties aren't available to JavaScript is there a good way to access them? eg
<html> <head> <title>expandable text area</title> <style type="text/css">
I want to remove a specific box when i click on the remove button in that box. I have a lot of boxes on a page but when i click on the remove btn it removes all the boxes. I just want to remove the box where i click on the delete btn.
This is the js code: $(".del").click(function() { $('div.floating-box').remove(); });
....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.
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?
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?
'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?
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...).
I am using Dreamweaver to open a pop up window when you click in a thundnail to make the picture bigger. In Dreamweaver you have the option to specify the dimensions of the pop up window(in my case the same as the photograph). It seems to work fine in Explorer, but Safari leaves a white border along the right and bottom edges(aprox 14 pix). I have tried to do the window smaller but then in other browsers you need scroll bars. I would like the new window be exactly the same size of the photograph. Is there any easy way to control this?
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...
I have a link, which triggers a script, but when the link is clicked, i want it to get a border around it... currently tried onclick="this.style.borderWidth = 1px"