JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 1st, 2013, 11:13 AM
sonny3 sonny3 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 7 sonny3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 13 m 17 sec
Reputation Power: 0
Disable right button mouse?

how can I disable the right mouse button over iframe?
you have any idea?

Reply With Quote
  #2  
Old March 1st, 2013, 03:54 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,835 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 1 Day 22 h 40 sec
Reputation Power: 4192
Are you sure you want to annoy your users? There are usually ways to get around whatever it is you're trying to block. Some browsers even have an extension that disables right-click-blocking scripts.
Comments on this post
Kastro187420 agrees: I can't believe there are people who still try to do that to people who visit their site =/
__________________
Spreading knowledge, one newbie at a time. I'm available for hire at Dynamic Site Solutions.

Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

Remember people spend most of their time on other people's sites (so don't violate web design conventions).

Reply With Quote
  #3  
Old March 1st, 2013, 10:50 PM
sonny3 sonny3 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 7 sonny3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 13 m 17 sec
Reputation Power: 0
Quote:
Originally Posted by Kravvitz
Are you sure you want to annoy your users? There are usually ways to get around whatever it is you're trying to block. Some browsers even have an extension that disables right-click-blocking scripts.


I am sure, you have any idea?

Reply With Quote
  #4  
Old March 1st, 2013, 10:55 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,835 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 1 Day 22 h 40 sec
Reputation Power: 4192
No way comes to mind that doesn't require directly modifying the document loaded into the iframe.

Reply With Quote
  #5  
Old March 1st, 2013, 11:37 PM
web_loone08's Avatar
web_loone08 web_loone08 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Posts: 605 web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 16 h 30 m 44 sec
Reputation Power: 69
I have one idea, but it would involve not being able to access the content in the iframe (which your probably going to want to be able to access, so you may not want to do this) and you would have to set the iframe width and height; to the size you want to display it at, because you could not access the scrollbars either. That would be the main drawback for you to have to deal with. You could use a transparent GIF and CSS to cover the contents of the iframe and set the GIF oncontentmenu event to return false.
Code:
<style>
#framedContent {
width:400px;
height:300px;
}
#framedContent img {
position:absolute;
width:400px;
height:300px;
}
#framedContent iframe {
width:400px;
height:300px;
}
</style>

<div id="framedContent">
<img src="http://upload.wikimedia.org/wikipedia/commons/c/ce/Transparent.gif" oncontextmenu="return false"/>
<iframe src="http://forums.devshed.com/" scrolling="no"></iframe>
</div>
This idea would only be good, if you just are basically wanting to have the page view-able through a figurative window. This is an old advert idea/concept; that is still commonly used by online advertising/marketing companies, such as PointRoll. Otherwise, my advice would be to scrape the content, of the page, your putting in your iframe and display the scraped content back into your page in an element, like a div. Then set-up your CSS for this div; with a specific height and width. Then set the overflow to auto and/or give it a border. This would give the impression of a iframe and if someone tried to open a context menu, the content would be in your page; so it would look like it's your content, but maybe that would not matter to you, either way. Assumingly, your not wanting someone to see your source code, because your not wanting it to be stolen, but their are several ways around this. So basically and overall..., I would have to agree with Kravvitz.
Comments on this post
sonny3 agrees: good idea

Reply With Quote
  #6  
Old March 1st, 2013, 11:43 PM
sonny3 sonny3 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 7 sonny3 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 13 m 17 sec
Reputation Power: 0
Quote:
Originally Posted by web_loone08
I have one idea, but it would involve not being able to access the content in the iframe (which your probably going to want to be able to access, so you may not want to do this) and you would have to set the iframe width and height; to the size you want to display it at, because you could not access the scrollbars either. That would be the main drawback for you to have to deal with. You could use a transparent GIF and CSS to cover the contents of the iframe and set the GIF oncontentmenu event to return false.
Code:
<style>
#framedContent {
width:400px;
height:300px;
}
#framedContent img {
position:absolute;
width:400px;
height:300px;
}
#framedContent iframe {
width:400px;
height:300px;
}
</style>

<div id="framedContent">
<img src="http://upload.wikimedia.org/wikipedia/commons/c/ce/Transparent.gif" oncontextmenu="return false"/>
<iframe src="http://forums.devshed.com/" scrolling="no"></iframe>
</div>
This idea would only be good, if you just are basically wanting to have the page view-able through a figurative window. This is an old advert idea/concept; that is still commonly used by online advertising/marketing companies, such as PointRoll. Otherwise, my advice would be to scrape the content, of the page, your putting in your iframe and display the scraped content back into your page in an element, like a div. Then set-up your CSS for this div; with a specific height and width. Then set the overflow to auto and/or give it a border. This would give the impression of a iframe and if someone tried to open a context menu, the content would be in your page; so it would look like it's your content, but maybe that would not matter to you, either way. Assumingly, your not wanting someone to see your source code, because your not wanting it to be stolen, but their are several ways around this. So basically and overall..., I would have to agree with Kravvitz.


this is a good idea, thanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Disable right button mouse?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap