Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
104
rated 0 times [  108] [ 4]  / answers: 1 / hits: 35601  / 13 Years ago, wed, january 18, 2012, 12:00:00

I have a div tag inside a table cell and and a hyperlink tag in another cell and on i want open a specific url onmouseover on hyperlink inside the div tag.the url is to my pdf file.Please anyone tell me how can i do this thorugh Javascript or anyother method


More From » html

 Answers
13

Something like this:



<table>
<tr>
<td>
<a href=/pdfs/test1.pdf onmouseover=previewUrl(this.href,'div1')>google</a>
</td>
<td>
<div id=div1 style=width:400px;height:200px;border:1px solid #ddd;></div>
</td>
</tr>
</table>

<script>
function previewUrl(url,target){
//use timeout coz mousehover fires several times
clearTimeout(window.ht);
window.ht = setTimeout(function(){
var div = document.getElementById(target);
div.innerHTML = '<iframe style=width:100%;height:100%; frameborder=0 src=' + url + ' />';
},20);
}
</script>

[#87951] Tuesday, January 17, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tayla

Total Points: 681
Total Questions: 102
Total Answers: 108

Location: Marshall Islands
Member since Tue, Sep 21, 2021
3 Years ago
tayla questions
Fri, Mar 5, 21, 00:00, 3 Years ago
Wed, Oct 28, 20, 00:00, 4 Years ago
Thu, Apr 9, 20, 00:00, 4 Years ago
;