473,386 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

JavaScript - block links on iframes

1
Ok, this post is not really a question, but I didn't find a way to reply on an existent post. Javascript is NOT needed, anyway it can be disabled by the user. So this is THE UNIVERSAL solution (to my question...!):

Expand|Select|Wrap|Line Numbers
  1. <div class="positioner"  style="width:402px;height:302px;border:none;margin:50px auto">
  2.     <iframe src="thelinker.html" style="position:absolute;width:400px;height:300px;border:1px solid #222;overflow:hidden"></iframe>
  3.     <div style="position:absolute;width:400px;height:300px;border:1px solid #fff;background:#fff;opacity:0.001"></div>
  4. </div>
  5.  
  6. <div class="positioner" style="width:402px;height:302px">
  7.     <iframe src="thelinker.html" style="position:absolute;width:400px;height:300px;border:1px solid #222;overflow:hidden"></iframe>
  8.     <div style="position:absolute;width:400px;height:300px;border:1px solid #fff;background:#fff;opacity:0.001"></div>
  9. </div>
  10.  
To work, absolutely you have to decide the size of the iframe. In this case 400 x 300 (px) + 1px of border.

The "positioner" is needed to know the origin of iframe.

Opacity property is needed for IE. Else nothing will work.

I tested it on all major browser but I can't know about IE < 8.
Oct 23 '12 #1
0 1248

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: leegold2 | last post by:
Can anyone recommend links that explain esp. show examples of how to use PHP and javascipt in the same page? Thanks. Lee G.
1
by: Griff | last post by:
Hi I've got to get performance stats for a website. The links within the web site aren't normal URLs but JavaScript links, e.g. <A HREF="javascript: if (document.Main.ParentID &&...
1
by: John | last post by:
Hi, I want to set a directory and an image name as a js variable and later call those vars as and html link. I am not doing this correctly, so I ask for help. Any advice is appreciated. Chuck Here...
3
by: Adonis | last post by:
I have a simple javascript that reads xml data from my site using the XMLHttpRequest/ActiveXObject function, which later clears a predefined div and updates it with the requested data, to update I...
5
by: Steve | last post by:
I just noticed, in IE6, when navagating from one page to another with the same basic layout (centered top graphic, for example), that a page with a <script> block in the <head> shifts the HTML...
0
by: ruca | last post by:
I have a file with javascript programming (in this case is a run time clock, that display hours and date at real time). In my old application I have this clock displying where I want, but now in...
4
by: Cliff Harris | last post by:
Is there a way for me to globally add a javascript block to all pages? I was hoping I could use one of the application events, but I don't seem to have access to the page object to use...
14
by: maidane | last post by:
Hi, I got the following situation using the AC_Quicktime library. Apple recommend to use a Javascript call to generate the OBJECT tag (http://developer.apple.com/internet/ieembedprep.html). I...
10
by: magnesium | last post by:
I have this under-construction page, If you try and select the link coming from the bottom with your mouse, you'll notice, that before the actual link is selected, the td background will change. you...
7
by: tony waria | last post by:
I'm having trouble finding a way to get javascript block from execution. I have a html form where a user enters email and password I want to do basic validation in javascript (1) email is...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.