Activate Hyperlink After Holding Down Mouse For 3 Seconds In An Image Map?
Jul 26, 2010
I have done one project in javascript so far and have had no schooling on the topic, however I have learned quite a lot in the last few months from this thing called the 'internet'. So far I managed to make an html image map that has various tooltips which will appear onmouseover, and the tooltip disappears onmouseout. Each point of coords that i have defined has a hyperlink to a different page on the internet. It works just like i wanted it to and i couldn't be happier, that is, when i'm using a mouse...
When i am using a touchscreen device it is a different story. specifically i'm trying to port my html page to android as i figured it would be easy with the android sdk and webview (it was, but read on). What i found when i used the 'app' on my phone was that onmouseover works when you touch the screen, however it also registers as a click, so pop goes the tooltip, and i'm whisked away to my webpage. not the desired result.
Ideally I would like to hold down the screen for 3 seconds and then the hyperlink would activate, but i decided that just getting the thing functional would suffice for the time beaing so i tried to include some 'ondblclick' that would trigger a document.location. This worked fine on a web browser again, but had no result on the touchscreen. I decided to abandon this half step because I have read that ondblclick doesn't work in an image map and it isn't my intended result anyway.
I have found a lot of javascript and jquery samples that emulate the onHold event that i'm trying to achieve, both on this forum and all over the internet, however these samples are overly complex and are focused on looping an action, such as incrementally increasing a value or zooming or whatever. I just want to redirect the user to another page if they trigger 'onmousedown' for 3 seconds.
View 6 Replies
ADVERTISEMENT
Jul 20, 2005
I'm working on a small javascript application where I'd like to get one
behavior when a user clicks on an image (image swap), but when they
simply hold down the mouse button for a second, they get another
behavior (drop down menu).
The former seems pretty easy -- just assign the handler for the onClick
event to the swapping function. The latter, however, seems more
involved.... I know I'd assign the onMouseDown handler to a different
function, and then.... after a 1 second or so I'd want to test whether
or not the mouse buttom was still being held down. Except that I have no
idea how to do that (both the waiting part and the actual test itself).
The idea that does occur to me is to have some kind of data structure
associated with the clickable image. I could have functions associated
with the onMouseUp and onMouseDown handlers to set a flag.... as soon as
onMouseDown is called, it sets the flag to 0, then it waits 1 second,
and checks to see if the flag is 0. If onMouseUp has been called, it
will have set the flag to 1, and we call the plain old click handler. If
the flag is still 0, then I know to do the popup/drowpdown menu.
I'm a little worried about the timing between the different flows of
control, though, and I'm also wondering if there's not simply a better
way to do it.
View 1 Replies
View Related
Aug 3, 2011
I have an img#info that I want to fade in when a div#trigger is hovered over. Then I want to be able to move the mouse over to the image and click a hot spot there, without the image disappearing because I moved off of div#trigger.
The code to fade in img#info is simply:
$(document).ready(function() {
$('img#info').css('opacity', 0);
$("div#trigger").hover(
function() {$("img#info").animate({'opacity': 1}, 1000);},
function() {$("img#info").animate({'opacity': 0}, 1000);}
);
});
This works fine as far as fading the image in and out. I tried then adding a hover statement for the img itself, below, but this doesn't work at all. The image is now always on, even though the alerts never fire when I roll on and off the image:
$(document).ready(function() {
$('img#info').css('opacity', 0);
$("div#trigger").hover(
function() {$("img#info").animate({'opacity': 1}, 1000);},
[Code]....
View 2 Replies
View Related
Dec 12, 2005
I have an image with links on it for my site. When I hover over the links, it loads another image below, with sub categories. Is it possible for the onMouseOver code to also activate an image map, so that the sub menu links are clickable? I need to have different image maps so that the hover areas correspond to the sections of the image Code:
View 4 Replies
View Related
Apr 22, 2011
how to make the image a hyperlink to specific urls rather than the image in its own page in the contenflow.js? I've found that if you comment out this line: window.location.href=A You will successfully delete the hyperlinks that link to the full size image. However, I'd like to have a click on each image take you to individual specific pages. PS> I'm a designer not a javascript coder -- so detailed explanations are needed. Documentation: [URL]
View 3 Replies
View Related
Jun 20, 2011
I want to activate an image slider that is placed in a div loaded through an Ajax request. I'm using the JQuery Plugin Anythingslider. I've tried to use code similar to this without success:[URL].. The slide script works if loaded together with main page.But how do I activate a slider placed in a div that has been loaded through an Ajax request?
View 3 Replies
View Related
May 20, 2009
I just started with Jquery:
<script type="text/javascript">
$(document).ready(function() {
$('#desperation input[type=image]').attr('disabled', true).fadeTo
("fast", 0.10);
$('#1').attr('disabled', false).fadeTo("fast", 0.70);
});
$('#1').toggle(
function () {
$('#1').click(function() {
$('#1').fadeTo("fast", 1.00).attr('checked', true);
$('#2').attr('disabled', false);
});},
function () {
$('#1').click(function() {
$('#1').fadeTo("fast", 0.70).attr('checked', false);
$('#2').attr('disabled', true);
});});
</script>
<div id="skill">
<form action="javascript:void(null);" method="post"
enctype="application/x-www-form-urlencoded" id="skillplanner"
name="skillplanner" >
<fieldset id="desperation"><legend>Freetrader Skills: Desperation</
legend>
<input type="image" src="files/icons/underdog.png" id="1"></input>
<input type="image" src="files/icons/dump_guns.png" id="2"></input>
<input type="image" src="files/icons/desperation_fire.png" id="3"></input>
<input type="image" src="files/icons/rum_ration.png" id="4"></input>
<input type="image" src="files/icons/hasty_fire.png" id="5"></input>
</fieldset></form></div>
The problem is with the toggle function. On click it should "check" clicked one and activate next one. Function doesnt work and I dont have a clue....
View 1 Replies
View Related
Oct 6, 2011
i want to change the background image of a webpage every few seconds to a different image... i've written this code but it doesnt seem to work.
<script language="Javascript">
window.onload = backgroundchange();
function backgroundchange()[code]...
View 3 Replies
View Related
Mar 1, 2011
I need to load a different image after, lets say 10 seconds.
So image1.gif will be displayed when the page loads then after say 10 seconds image2.png will replace image1.gif.
View 4 Replies
View Related
Oct 24, 2006
i have a script that changes an image in the main frame when you hover over a hyperlink in the navigation frame. however i would like to extend this and make the image that appears to be a hyperlink. the code i have is below. the navigation frame:-
<script language="JavaScript">
internet_main = window.parent.internet_main("internet_main.html","rollWindow","internet_main");
function getRolling(whichBrief)
{
internet_main.document.images.rollpic.src = whichBrief;
}
</script>
<li><font color="#DB241C">Residential</font>
<ul>
<li><a href="desktop" TARGET="internet_main" onMouseOver="getRolling(desktop')">> Orb Surftalk Extra</a></li>
<li><a href="desktop" TARGET="internet_main" onMouseOver="getRolling(desktop)">> Orb Surftalk Extra +</a></li>
</ul>
</li>
the main frame:-
<script language="JavaScript">
a=new Image();a.src="desktoplank.png";
</script>
<img src="desktoplank.png" name="rollpic">
View 7 Replies
View Related
Aug 9, 2009
I've got to have a typo somewhere, but i can't seem to find it. I need a new pair of eyes to point it out for me. background: trying to code a mouseover link for a nav bar. everything is working( hyperlink, normal image shows up) but when i mouse over the image swap doesn't happen.
I have 2 parts of code. 1st preloads images and does the swap function. loads in <head> See below:
[Code]...
View 5 Replies
View Related
Jun 20, 2010
I am in the process of developing a website. I would like to use some images. The image should zoom on mouse over and mouse click i.e the image should zoom to h:100*W:100 on mouse over and on mouse click it should be zoomed to h:1000*w:1000. Also I would like to change the mouse over image and mouse click image before zooming.
View 1 Replies
View Related
Oct 19, 2006
can anyone help with a script which will change an image in a different frame when you hover over a link in a navigation frame. i have mamanged to get the images to change within the same frame, but having trouble changing it within another frame. Code:
View 2 Replies
View Related
Mar 16, 2010
Can a foto that is being viewed via the Lightbox effect be also hyperlinked?
For example look at this page:
http://www.anoox.com/test/lbox/test_1.htm
If you know about Light box effect you know that the regular href tag for linking an image into a web page is taken over by the light box effect to show the larger version of the image in the light box window, so then how can such an image that is loaded into light box window be hyperlinked itself?
And if you know how, can you kindly show a few examples?
View 4 Replies
View Related
Feb 9, 2008
I would like to know if I can use javascript to enable users to mouseover a hyperlink so that an image would pop up (just while they're hovering over the hyperlink). I am not asking how to use JS to make an existing image change, as there is no image on the page to start with.
I have searched for two days and keep finding out how to make a hyperlink change an existing image, or mousing over one image to change another, but none to popup an image, from nothing, only while someone is mousing over a hyperlink.
View 11 Replies
View Related
Sep 23, 2009
I have been unable to insert anything other than plain text and line breaks using innerHTML. I would like to use it to insert hyperlinks and images as well.[code]...
View 7 Replies
View Related
Feb 19, 2009
Am having 5 images,
image1,image2 upto image5,
when the page is loaded initially i want to display image1 for 8second, then next 5second image2, next 5 seconds image3,next5 secondimage4,next5second image5,
then again i want to display imag1 for 8 second ...continue this loop,
Using java script i want to do this , any good suggestion for this,,
i have tried like set interval function. how to disable other image and how to call the images for 5sec,
View 2 Replies
View Related
Jun 28, 2009
How do i change an image every 3 seconds between 3 images and on a loop? What is the simplest way to do it?
View 3 Replies
View Related
Nov 9, 2011
topic has been answered
View 1 Replies
View Related
Sep 15, 2009
What I require seems straightforward, for each image in my gallery I would like to have a unique URL, so if there are 5 images then 5 different URL's thus enabling me to toggle content relating to the particular image, the code I believe I need to change is as follows;
[Code].....
View 3 Replies
View Related
Jul 8, 2010
I am looking for a plugin that will popup a full size image WITH HYPERLINK when user clicks the thumbnail image link. I found [url] is useful but I can't add the hyperlink to the full size popup image.
View 1 Replies
View Related
Apr 29, 2011
I need a code to load imagexxx.png into a div every 5 seconds because the image changes dynamically and i need this using Ajax? the dynamic image generated by a php file > all what i need is run the ajax call every 5 minutes which run php script that return with an image ...
View 1 Replies
View Related
Oct 25, 2011
The objective is to have an image fade to another one progressivly while the mouse is over, when its not it fades back to the original, whether or not it faded to the target completely or not. That is, if it takes 1 second to fade completely to the other image, and you take your mouse off it at 0.5 seconds, it will begin to fade back to the original. I have a problem where I want to give this ability to multiple images (thumbnails) on a page, without having reams and reams of code and instead just have one function accomadate any number of images.
[Code]...
View 5 Replies
View Related
Mar 12, 2011
I've been trying to have an image be placed during a mouse over or mouse click event. The closest to accomplishing this is having the image be replaced by the image I want to overlay.
View 2 Replies
View Related
Mar 28, 2010
I have embed a flash player known as: JW player into my website and put it into a div. Now my problem is I want javascript to hide the div containing the flash player for atleast a few seconds to display a loading image.gif. How would I set this up?
View 2 Replies
View Related
Feb 27, 2010
I am still designing the website and want some flexibility. I am capturing the mouse clicks fine on top of an image, but the coordinates are absolute and not relative to the image. How can I capture mouse clicks relative to the image so that I can move the image anywhere in my website?
View 3 Replies
View Related