Setting The Src Of An Image To Nothing
Nov 1, 2005
How do you set the src of an image to nothing?
I have a form that displays an icon beside a field if it contains a negative value and want to remove the icon when the value is no longer negative.
I was doing note_icon.src = '' but this produces "Directory Index Forbidden by Rule" messages in the server error log because the empty string is being interpreted as meaning the directory where the script is running on the server.
View 1 Replies
ADVERTISEMENT
May 12, 2010
I have a div set up like this
<div id='y' style='background-image: url(./randomcolor.php?ibase=
<?
php echo $entity
->
[code]....
I am having an issue with setting the background-image of a another div #x to the background image of #y.Correct me if I am wrong but I think you would do this in a simple case by saying
$
(
'#x'
).
[code]....
So when it does it, it is getting the URL of the generator (I logged it. what is actually being passed is [URL] This would require a server call to generate a new image, In this particular application, even if it wasn't exactly the image y had it would be acceptable. But it's not doing it. It is not getting any image at all. Am I doing something wrong, i.e. is it supposed to just work? I would think not, since the page has already been rendered. This is almost an ajax situation but I don't know how to do it for an image. I don't really want to generate a new image anyway, I'd be very happy to get the one that's already there. How would I access the actual image already attached to y and not do another server call?
View 2 Replies
View Related
Jan 6, 2010
I'm using Javascript to change an image on a page without reloading the page. The problem is that my images are various widths (but identical heights), yet each image I change it to uses the width of the first image.
[Code]...
View 4 Replies
View Related
Oct 5, 2009
I'm trying to set up an image's source from a function within the document's head, but to no avail. The code is something like this:
<head>
.....js code.....
function updatePieChart()
{
document.pie_chart.src = "piechart.php?p1&p2"; // php-generated image, with parameters
}
[Code]...
View 2 Replies
View Related
May 18, 2006
This probably isn't that difficult, but it's a bit out of my league.
What I'm looking to do is find an image name, I think using document.images [], then strip the extension, then use the DOM to set the result as the class name of a div.
Something like this:
document.getElementById("thediv").className = [image src without extension];
The image that I'm looking to identify will change from 01.gif to 40.gif, and is served by a lame proprietary server-side tool. I can't control what it is at any time, but it will always be from 01.gif to 40.gif.
There will be corresponding styles in my stylesheet that would give me the effect of <div id="thediv" class="01"> (except set by the DOM) after the script has done its magic.
View 11 Replies
View Related
Aug 10, 2011
I have a web page that has a background image behind a signup form. I need the background image to print.
Here's how the code starts:
<table width="750" height="756" background="http:trustdale.com/wp-content/uploads/2011/08_Images/RBMCertificate.png" cellpadding="65" cellspacing="100">
View 1 Replies
View Related
Jul 31, 2010
i installed jondesigns smooth gallery from [URL] All installed fine, minus one problem with setting the thumbnails up. It asks for this to be entered im just not sure where that code should go: useThumbGenerator: true also it asks for a cache folder to be writeable does that just go anywhere or? Heres my version here: [URL]
View 3 Replies
View Related
Jul 20, 2011
I have an image that has been resized via CSS to show as 100x100px on an HTML page. When clicked, I want to open the image in a colorbox - so the user can see the non resized/squashed version as it will normally appear. I've worked out how to set the path of the href to itself (so this doesn't have to be changed every time) (see below), although not sure how to get the colorbox part working - I tried changing 'each' to 'colorbox' - as per how you would normally assign the colorbox, and it opens, it just doesn't load the image in it.
<div class="logoImage"><img src="../tym_img_shared/background-2.jpg" alt="Your company logo" /></div>
$(document).ready(function(){
$('div.logoImage img').each(function(){
var $this = $(this);
$this.wrap('<a href="' + $this.attr('src') + '"></a>');
});
});
Thinking about it, perhaps it would be easier to also set the 're' attribute of the link whist setting the source?
$(document).ready(function(){
$('div.logoImage img').each(function(){
var $this = $(this);
$this.wrap('<a rel="gallery" href="' + $this.attr('src') + '"></a>');
});
});
Doesn't work for some reason - but it does if I hardcode the URL and rel?
View 6 Replies
View Related
Sep 1, 2009
I have a hidden popup that I populate with content and it dynamically expands to the size of the content. I then show the popup. When a user clicks on another link, it populates the popup with longer or shorter content. When the content is SHORTER, it seems to show the background image that I'm using expanding to the height of the previous size of the popup. I've tried setting the height manually with JS, no luck. This only happens on IE6.
View 1 Replies
View Related
Feb 2, 2010
I want to have a big image and say 5 small thumbnails underneath. When the user clicks a thumbnail, the image loads where the previous big image was. Is there a standard way to do this?
View 3 Replies
View Related
Sep 27, 2011
i have image button i need to display image .if the size of the image button is 100*100 and image size is 50*50 .the remaining space of the image button should be empty.the image should not stretch.
View 1 Replies
View Related
Jul 23, 2005
I have an object
<button id=summer>
Now I want to dynamically set an event for this object:
function foo()
{
}
myobject = document.getElementById("summer");
myobject.onClick = foo;
Problem is that I want to give the function an argument. "foo(this)" instead
of just "foo".
How can I achieve that?
View 2 Replies
View Related
Jul 23, 2005
I need to set two cookies. One to be used for redirection and page loading,
which i have now and works and a second one that is used to write
information on a page.
Both are to be set automatically when loading the page. The second will
will set a company name like "Your company name". Then when the next page
is loaded it will put "Your company name" on the webpage. And like I said
before the first cookie is set for navigation purposes.
View 1 Replies
View Related
Jul 23, 2005
I need to set tabs on java generated pages. Pages have four sections:
header, sidebar, body, and footer. The sidebar and body change dynamically.
The tab key must go to anchors, fields, and buttons doing all in the header
first, all in the sidebar second, etc. A base page contains includes for all
the pieces and has the body tag. Code:
View 8 Replies
View Related
Oct 30, 2006
I'm just getting into DHTML, and there's one thing I'm getting stuck on in my current project. I'm building a list of destinations to display in a window. Each one is in its own separate div. But I can't seem to figure out how to add a link to those div's on the fly in my script. Is there a way to do that in JavaScript?
View 2 Replies
View Related
Jul 20, 2005
Currently in my html document I use the onload command inthe body section to
set the focus to a certain field. eg
Is there a way to set the focus to another field in a different frame other
than the one that the current document is in?
In my example, I have a frame called "top" that I would like the focus
setting to whenever a certain document is loaded in the frame "main".
View 2 Replies
View Related
Oct 7, 2010
I have a simple table in which there are a collection of TRs inside a TBODY and a collection of TDs in each TR. I have a jQuery click event bound to a single TD in each TR. When I click onthis TD I use css to set its background color. When I click on the bound TD in another TR I want to be able to change the previously selected TD's background color and then change the newly clicked TD to a new background color. My click binding appears as follows:
.click(
function(){
var nRow = $(this).parent().parent().children90.index($(this).parent());
[code]....
View 2 Replies
View Related
Mar 23, 2010
I'm trying to set the drop down list value show on startup by it's value. For example, I'd like to select the value '50-09' when the page is loaded. Can someone point me in the right direction?
Code:
<select name="WeekId">
<option value="" selected> </option>
[code]....
View 4 Replies
View Related
Oct 5, 2011
I have the following drop-down box as an example:
How can I use the code below to set the value of the drop down without knowing its value number (3)?
View 11 Replies
View Related
Jul 18, 2007
Is there a small javascript snippet or something that can dynamically set the body ID on page load? I am using the Inverted Sliding Doors tabs from 456 Berea Street Code: but am trying to do so in a frameset [insert angry comments here] (I know I know, please don't harp!)... anyway, the tabs css sets the active tab using the body ID, but I can't seem to get it to recognize the body ID inside the frameset. Is there a javascript or some other code I could use to dynamically set the body ID? Or perhaps a better approach?
View 2 Replies
View Related
Jan 30, 2005
Is there an easy way for me to get visitors the option of setting a page as their homepage?
View 2 Replies
View Related
Jan 22, 2007
i am working on a script that triggers a blind down or blind up effect
by clicking on a particular link. it then remembers the status of that
choice by setting a cookie. Code:
View 12 Replies
View Related
May 4, 2010
cookies is not setting whats wrong with this,
<script type="text/javascript">
function validate_form(frm)
{[code]....
View 1 Replies
View Related
May 22, 2010
I made this:
Code:
And tried to change the value of the selection programatically with:
Code:
But the computer says after awhile that form.gallery_type_id.options[...].value is undefined in i.e. In Firefox, it works fine.
View 3 Replies
View Related
Jul 23, 2005
I use URL parameters to track the source of a click and track Pay-Per-Click
results. For example, if a click originates from Google AdWords, the URL is
www.mysite.com/?source=google. For Google this works fine, but for many
other Pay-Per-Click search engines, the URL parameter seems to get lost and
the user gets directed to www.msysite.com.
Let's call the search engine for which this does not work "dummy". I was
thinking about sending users directly to www.mysite.com/dummy.html, and
within dummy.html I would set the parameter within a JavaScript to what
"dummy", using this command: var source = "dummy".
This does not seem to work, the php program that is executed later within
the JavaScript does not correctly interpreted the source variable and
therefore does not register a click from search engine "dummy". So, the
question is, how can I set the source variable within the HTML if it has not
been passed as part of the URL.
View 3 Replies
View Related
Jul 23, 2005
I know that I can read/write custom properties of an object by using
the following:
Setting:
document.all['Control'].customProp = "this";
Getting:
document.all['Control'].customProp;
Is there a way I can run code when this custom property is set. Or
perhaps there is a way to create a custom method?
Example:
<span id="MySpan"><input type="text"></span>
I'd the property:
document.all['MySpan'].enabled = true;
To automatically do this:
document.all['MySpan'].controls[0].disabled = !thevalue;
OR the method
document.all['MySpan'].enable();
To do this:
document.all['MySpan'].disabled = false;
View 5 Replies
View Related