473,657 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JavaScript - block links on iframes

1 New Member
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 1255

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

Similar topics

2
1621
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
310
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 && document.Main.ParentName ) { document.Main.ParentID.value=''; document.Main.ParentName.value=''; } if (document.Main.fCatalogID && document.Main.fCatalogName ) {document.Main.fCatalogID.value=''; document.Main.fCatalogName.value='';}SetPageToShow('Catalog...
1
1170
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 is a basic example. <script type="text/javascript" language="javascript"> var dirpath = " http://www.blah.com/images/", image1 = "de-01.jpg"; </script>
3
1138
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 am using: <a href="javascript:function">yada</a> It works as it should in Firefox, but when in IE6 it does not, no error is reported. Am I missing something obvious? Also there is no action on the server when clicked (I am running a small...
5
1510
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 contents some number of pixels to the right. Other than putting a blank <script> block into each web page, or putting SCRIPT at the bottom of the BODY, any other way to work around this? Thanks
0
976
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 ..NET the clock don't appear. In old ASP I have define onLoad event in body calling show_clock function like this <body onload="show_clock()" > <table>
4
3047
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 RegisterClientScriptBlock. Is there a way for me to accomplish this without adding something to every page? Thanks, -cliff
14
2294
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 am storing String entries representing the innerHTML of a div that I will update at runtime. As a result, some of these string entries are actually loooking like: <script language="JavaScript" type="text/javascript">
10
5428
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 have to the select the text itself to make the link select. I don't know If I've explained it well... I tried height:100%, and width:100%; in the a:link area in the css... Tried margin-bottom:0, and none of it makes the "link area" spread out to the...
7
5417
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 entered (2) password is entered If both are not NULL then I call ajax (jquery - model) make a call to backend php to validate if the email and password is correct - During this period of time - I want the javascript to block from further execution.
0
8403
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8737
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8610
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2735
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.