Image Map: Action Onclick Of Area?

Feb 20, 2010

When a user clicks on an image on my site, I want to cause an action only if they click within some specified area.I have done this with some success with image maps and areas by specifying the href.But specifying the href allows me to provide a link to a new page. Rather, I need some javascript to be executed when the area is clicked and in the javascript I need to know which image on the page was clicked.

View 3 Replies


ADVERTISEMENT

OnClick Action Within H2

Oct 29, 2007

The goal for this page is to have different news feeds load in different tabs. When MSNBC is clicked, I want the RSS feed to load. Right now, you have to click the MSNBC tab and then click "Hello" right below it.

I have applied the same onClick to the "MSNBC" tab as in the "Hello" link but the onClick doesn't work.

Is this a javascript issue or a CSS issue? Do I have to have the link within the same p?
Any workarounds or is there something I'm doing wrong?

View 1 Replies View Related

OnClick: Confirm Or Cancel Action?

Apr 20, 2010

I have a problem to add confirmation function to my script. I have a table with data from database. "Delete" button is in each row of table to delete whole row from database (based on ID).I need to after click on "Delete" button there was confirmation to delete it or cancel. I made some tries but no matter I clicked "OK" or "CANCEL" delete was made.

Here's part of PHP code of my script:

PHP Code:

<?php
while($rows=mysql_fetch_array($result))
{
?>

[code]....

View 3 Replies View Related

Onclick Function Using Area Map?

Jul 14, 2009

I am trying to use an onclick function within an area map to extract data "wm-ex002" and place it into a text box within a form on another page. Can someone help solve my mystery?

This is the code within the area map on a page called products.htm:

<map name="showMap">
<area shape="rect" coords="24,8,102,108" href="order.htm" onClick="update('wm-ex002');">
</map>

This is the function on another page called order.htm

[Code]...

View 8 Replies View Related

JQuery :: Cancel The Submit Action Through Onclick?

Nov 4, 2010

I need to cancel the submit action via jquery through onclick. But its not working. Could you please advise me? I have copied my code below.

Code:-

<script language="javascript">
function validate(){
var prjname_selected=$("#prjname_selected").val();

[code]....

View 1 Replies View Related

JQuery :: Append A Button/onclick Action?

Jun 15, 2011

This is probably something simple that I am not aware of, but when I use append to add a <div> containing a button the button does not work. I've tried to test the appended div with an alert but the results come back as null as if there is nothing there even though the new div is visible on the page. Looking at the page source there is no new div present. Does this have something to do with the appended div not being registered with the DOM?

var newCartItem = "<div class='cartItem'>" + $(this).attr('id') + "<input class='deleteCartItem' type='button' value='Remove' /></div>";
$('#shoppingCartContents').append(newCartItem);
$('input.deleteCartItem').click(function()

[code]....

View 1 Replies View Related

IE Set Onclick Object Doesn't Support This Action / Fix It?

Sep 15, 2011

I have looked at the various posts about setting onclick in IE and I cannot see any that exactly describe the problem I am having.

Firstly I am not trying to set onclick by calling setAttribute, which most of the posts describe. I am simply assigning a value to the onclick attribute of the element, which those posts seem to imply.

Specifically I am getting "Object doesn't support this action" on the following line:
editButton.onclick= editCitation;
editCitation is already a function, so I do not see why I should have to wrap it in an anonymous function wrapper to get IE to permit the assignment.

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

Highlighting Image Map Area

Jul 23, 2005

I want to highlight the clicked area on an image by placing another image
on it. But it replaced the whole image, not the clicked area.

<head>
<script language="JavaScript" type="text/javascript">
function changeImagemap(newImage) {
if (js > 1.0) document ['plan'].src = eval(newImage + ".src");
}
</script>
<MAP NAME="MyMap">
<AREA SHAPE="rect" COORDS="216,358,237,378" alt="West Right 5"
onClick="changeImagemap('selected');self.status='selected' return true" >
<AREA SHAPE="rect" COORDS="216,378,237,398" alt="West Right 4">
<AREA SHAPE="rect" COORDS="216,399,237,419" alt="West Right 3">
<AREA SHAPE="rect" COORDS="216,419,237,439" alt="West Right 2">
<AREA SHAPE="rect" COORDS="216,439,237,459" alt="West Right 1">
<AREA SHAPE="rect" COORDS="270,491,291,511" alt="South Left 1">
<AREA SHAPE="rect" COORDS="289,494,310,514" alt="South Left 2">
<AREA SHAPE="rect" COORDS="310,495,331,515" alt="South Left 3">
<AREA SHAPE="rect" COORDS="330,495,351,515" alt="South Left 4">
<AREA SHAPE="rect" COORDS="349,494,371,515" alt="South Left 5">
<AREA SHAPE="rect" COORDS="369,495,390,515" alt="South Left 6">
<AREA SHAPE="rect" COORDS="390,495,411,515" alt="South Left 7">
</MAP>
</head>

<body>
<p>img name="plan" USEMAP="#MyMap" ismap border="0" src="Plan.jpg" width="837"
height="694"></p>

</body>

View 1 Replies View Related

Changing Image In Just One Area Of A Map?

Apr 3, 2011

I have a mapped image and I want to change mapped parts of the image. For example when I get a cursor over one area the image in that area would change for another (the same size of course). Or for example I have mapped solar system and after clicking one of the planet the planet will change color (so the image will be switched just in that area).

View 7 Replies View Related

Selecting An Area Of An Image?

May 20, 2010

I want to build a script that will essentially allow me to generate coordinates for an image map.For example:You open the page and have a specific image on the page that you want to use the image map for.You Click on a spot on the image and drag to make a square, then release the mouse button. Below the image, the coordinates for an image map will be displayed in a text field or whatever. You can simply copy and past into your code.(It's actually going to be a integral part of a larger management app, but If I can this down in and of itself, I can integrate it into the rest of the app easily.)

Now I was thinking I could just get the start and end coordinates of the mouse cursor (mousedown and mouseup) and then calculate appropriate image map coordinates from that. However there are a few snags and I'm not that fluent in javascript. I really know know what racecourses I have available. I also don't really know what to call the concept so searching in google is a piece by piece process.

View 7 Replies View Related

Restrict Area On Image But Get Coordinates?

Sep 13, 2009

I need to restrict an area on the image but also get the coordinates from the image. I am using a form element "input type=image" so I can get the X Y coordinates from an image. I don't want the user clicking on a whole image, in this case a map of a country. I don't want the users clicking off the country's borders in to another country and I want to be able to get the coordinates from inside the country. I have tried to mix the element from the form with the area shape so when someone will click on the image it will first verify if it's over the hotspot and if it's over the poly coords then it will allow the user to click, the form will submit and the coordinates will be stored into the database.

I just don't know how I could integrate javascript into this. This is my code, not really something functional, the coordinates will pass on to the next page as a variable but limiting the area where the users may click is something that I have not figured out. I can create an area shape but without getting the coordinates from the image. Anything will do, even without <input type=image , if there is some way around this so I can make this work.

<script type="text/javascript">
function myEye() {
document.coordform.submit();
}
</script>
<form action='store.php' method=post name="coordform"> .....

View 4 Replies View Related

Onmouseover Of Image Map Area, Display Corresponding DIV?

Apr 27, 2011

I have an image map with 6 areas.

<p class="center"><img src="images/car_feature.png" alt="" usemap="#car"/></p>
<map id="car" name="car">
<area shape="rect" coords="172,198,195,222" href="#" alt=""/>
<area shape="rect" coords="242,79,266,104" href="#" alt=""/>
<area shape="rect" coords="293,124,317,149" href="#" alt=""/>
<area shape="rect" coords="407,212,431,227" href="#" alt=""/>
<area shape="rect" coords="430,300,453,325" href="#" alt=""/>
<area shape="rect" coords="565,346,588,370" href="#" alt=""/>

[Code]...

View 19 Replies View Related

JQuery :: Restrict Hover Action To A Single Image

Jun 6, 2011

I m having trouble restricting an action to a single image. I am trying to make the background fade to full opacity on hover, and have that working like I want to. The problem is that when I hover one image, ALL the images fade to full opacity. Obviously it would be nice to only have the one that is being hovered over. I am sure it is just a simple thing in the code but I just can't figure out what it is.

[Code]...

View 2 Replies View Related

Jquery :: When Click The Cell Area The Image Changes To The Next

Jul 12, 2009

I have a table that is 3 by 3. Each table I have a blank image. I wanted to make it, so when you click the cell area the image changes to the next and then to the third and then back to the blank. eg. blankimage, image 1, image 2. So, I am using the click function to activate it and the attribute option to change the image.

[Code]....

View 4 Replies View Related

JQuery :: Simple Image Rollover Action For Navigation Buttons

Aug 20, 2011

I am having a bit of trouble attempting to get this button roll over stuff working. I have looked up some really simple code to create a image rollover action for my navigation buttons. But nothing happens when I hover on any of the buttons though. When I use firebug to figure out what is wrong, it says that $(this) is the document and not the image button. The example/preview is here: [URL].

This is the jQuery code here for quick reference:
<script type="text/javascript">
$(document).ready(function(){
$('#navigation img').hover(
function() {
$(this).src = $(this).src.replace("Red","Yellow");
}, function() {
$(this).src = $(this).src.replace("Yellow","Red");
}); });
</script>

View 3 Replies View Related

Image Rollover - Capture Event Action Without Passing To Function

Aug 3, 2011

I'm really just playing around, trying to be as unobtrusive as possible, meaning that I didn't want to just do the standard on mouseover/onmouseout event actions inline in my html. My attempt was relatively close, I just need a way to be able to capture the event action without passing it into a function?

Code:
<script>
var getTabs = function(){
var allTabs = document.getElementsByTagName("div");
for (var i=0;i<allTabs.length;i++){
if (allTabs[i].className == "tabs"){
if (allTabs[i].id == this.id){
if (this.onmouseover != null){
//alert("MouseOVer");
document.getElementById(this.id).style.backgroundColor = "#465D77";
} else if (this.onmouseout != null) {
//alert("MouseOOut");
document.getElementById(this.id).style.backgroundColor = "#1a3757";
}}}}}
onload = function(){
document.getElementById("tabHR").onmouseover = getTabs;
document.getElementById("tabHR").onmouseout = getTabs;
}
</script>

HTML Code:
<!-- Begin Tabs Container -->
<div id="tabsContainer">
<div id="tabGlobal" class="tabsActive">
Home
</div>
<div id="tabHR" class="tabs">
HR Edit
</div>
<div id="tabReports" class="tabs">
Reporting
</div>
<div id="tabData" class="tabs">
Data
</div>
</div>
<!-- End Tabs Container -->

View 2 Replies View Related

JQuery :: Fullsize Image Not Displaying In Preview Area?

Jan 3, 2012

I am working in Dreamweaver CS4 with both HTML and Javascript. I created a preview area and some thumbnails beneath. Each thumbnail is linked to a full size image. So far, so good. I'm attempting to follow a Javascript tutorial to make a lightbox. I added CSS rules and the javascript code in the hopes of having my thumbnail show the image in the clickable preview area when hovering. However, my fullsize image does not display in the preview area. Interestingly, when I hover over the preview, I see at the bottom of my browser that it is still linked, just not displaying. The preview area is blank.

View 4 Replies View Related

Showing An Image Inside Content Area Of Accordion?

Jul 9, 2010

I've create a jquery accordian using the code provided in the main accordian page. It all works brilliantly, except when I try to show an image that will link to another page, the image does not show.

For example, In one of the accordion content areas, the code shows:

<div> <h3><a href="#">How can I get a price quote?</a></h3> <div>Simply click on the button below to open up Power Image's all-inclusive Quick Quote tool, then follow the prompts to enter your style, color, ink colors, and quantity. <img src="images/quote.png" width="100" height="30">When you're done, click "Total" to see your all-inclusive price! Additionally, once you get a quote in the Design Center, your price quote updates live under your design as you create.</div> </div>

When clicking on the header to open the content however, the image does not show. I have checked the location of the image multiple times, and it is right. There isn't even a broken image that shows where the image should be. What code do I need to add to allow images to be inside the content area of accordions?

View 1 Replies View Related

Image Gallery Captions - Possible To Use HTML In Description Area

Aug 20, 2010

I've got a simple javascript image gallery I'm using, but I was wondering if it would be possible to use HTML in the description area. Basically I want to be able to create paragraphs, bold text, and links in the description area. Is it possible? Here's what I'm using:

<script type="text/javascript" language="javascript">
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('placeholder')
.src = whichpic.href;
if (whichpic.title) {
document.getElementById('desc')
.childNodes[0].nodeValue = whichpic.title;
} else {
document.getElementById('desc')
.childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
}
return false;
} else {
return true;
}}
</script>

Then the markup:
<img id="placeholder" src="images/twoBottles.jpg" alt="" /> (Where the image appears)
<p id="desc">Choose an image to begin</p> (Where the image descriptions appear)
<a onclick="return showPic(this)" href="images/condiments.jpg" title="The description which in some cases is 2 or 3 paragraphs long and I would like to format somehow">two bottles</a> (clicking this text opens that picture in the image area).

View 4 Replies View Related

Linked Fullsize Image Not Showing Up In Preview Area

Dec 14, 2011

I am working in Dreamweaver CS4 with both HTML and Javascript. I created a preview area and some thumbnails beneath. Each thumbnail is linked to a full size image. So far, so good. I'm attempting to follow a Javascript tutorial to make a lightbox. I added CSS rules and the javascript code (below) in the hopes of having my thumbnail show the image in the clickable preview area when hovering. However, my fullsize image does not display in the preview area. Interestingly, when I hover over the preview, I see at the bottom of my browser that it is still linked, just not displaying. The preview area is blank.

Javascript:

View 1 Replies View Related

JQuery :: For An Action On A Element, Stop The Action On His Parent?

Dec 2, 2009

Is that possible when you click a child that the function on the parent don't run.

In these example, if I click on 'h2 > a
', both elements triggers functions ('h2' & 'a')
What I wan't is that if I click on 'h2 > a

[code]....

View 1 Replies View Related

JQuery :: Stop A Action Hover And Just The Last Action Happen?

Jul 23, 2011

I need to know how stop a action hover and just the last action happen

View 2 Replies View Related

Changing The Action Of A Form With An Input Named Action?

Feb 16, 2009

I have come across a very interesting problem that seems to be impossible to solve. Basically a web application that I am working on relies on a JavaScript function called go to change the input named view to the page name and submit the form. This form's type is post, so no values are included in the actual URL string. There is also another input called action and it's value is view. This is to tell the application that the user would like to view a page. The problem is because of the variables being of method post, page refreshes and back and forwards return errors because the post variables view and action aren't sent with the required data. To somewhat solve this problem I have created a feature that tells the application that if the post value page is empty then to try and get a GET var called page. To insert this var into the go javascript function I simple add this code

document.go.action = document.go.action+"&page="+page;

This line basically adds &page=[page] to the action of the form. The problem is, this code doesn't work because action is also the name of a form element. Referencing document.go.action refers to the input element named action and not to the form's action. Changing the named of the action input value is out of the question (Way to much changing of code, and possible room for error). What can I do to change the action of the form without referencing the input named action. Here is my go form and the JavaScript code:

<form name="go" action"index.php?sid=123" method="post">
<input type="hidden" name="action" value="view" />
<input type="hidden" name="view" value="" />
</form>

[Code]....

View 6 Replies View Related

Alter The Area And Level Of Magnification Shown From The Original Image Onto The New Box?

Jun 2, 2011

The script below magnifies a small portion of a larger image in a separate box. Is there any way I can add to the code to alter the area and level of magnification shown from the original image onto the new box?

Code:
<script type="text/javascript">
function DoMagnify(sender, e)
{
var posx = 0;
var posy = 0;
if (!e) var e = window.event;
[Code]...

View 1 Replies View Related

AJAX :: Save Image Area(x And Y Cordinate) From The Current Webpage To Server?

Jul 6, 2010

have to copy and save a selected area from a .php or .html file it contains a table in the my current webpage and have to copy and save a table data or image in table data so that It can be available as saved image for future reference.

View 1 Replies View Related







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