Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    37
    Thanks
    2
    Thanked 0 Times in 0 Posts

    no click & no right click in iframe, but with scrolling abilities.

    whoops, i accidentally posted in some really old post :O sorry about that.
    anyways,

    i have a wordpress website, but if its not possible with a wordpress website, ill just use a typical html.
    i need something that will make an iframe for me [of another website] but make it impossible to click or right-click, BUT can scroll.
    Thank you.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    but make it impossible to click or right-click, BUT can scroll.
    Impossible! There's no fool proof method to block users' freedoms.
    Last edited by abduraooft; 10-28-2010 at 03:54 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,332
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Here we go again...lol There is a long loooonngggg thread, and I do believe it has been made a sticky, about this same topic in one of the other forums here at this site. Why not search for it.

    ok I found it for you.

    http://codingforums.com/showthread.php?t=4437
    Last edited by teedoff; 10-28-2010 at 03:45 PM.

  • #4
    New Coder
    Join Date
    Jun 2010
    Posts
    37
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by teedoff View Post
    Here we go again...lol There is a long loooonngggg thread, and I do believe it has been made a sticky, about this same topic in one of the other forums here at this site. Why not search for it.

    ok I found it for you.

    http://codingforums.com/showthread.php?t=4437
    no i meant, disable clicks IN the iframe. but im not going to do that, maybe.
    i might, so it might be helpful to gain some information/knowledge...
    i dont find anything on that thread that would block a right-click/left-click/any-click in an IFRAME.

  • #5
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,332
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Quote Originally Posted by jeree View Post
    no i meant, disable clicks IN the iframe. but im not going to do that, maybe.
    i might, so it might be helpful to gain some information/knowledge...
    i dont find anything on that thread that would block a right-click/left-click/any-click in an IFRAME.
    Well this code here seems to block users from right clicking. Havent tested it but if thats all you want to do then try it out. I think you would have to put the code IN the iframe you want to manipulate.

    Code:
    Wanna bet?
    
    enter this script into the head of your document
    
    
    <SCRIPT LANGUAGE="Javascript"><!--
    var isNS = (navigator.appName == "Netscape") ? 1 : 0;
    var EnableRightClick = 0;
    if(isNS) 
    document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
    function mischandler(){
    if(EnableRightClick==1){ return true; }
    else {return false; }
    }
    function mousehandler(e){
    if(EnableRightClick==1){ return true; }
    var myevent = (isNS) ? e : event;
    var eventbutton = (isNS) ? myevent.which : myevent.button;
    if((eventbutton==2)||(eventbutton==3)) return false;
    }
    function keyhandler(e) {
    var myevent = (isNS) ? e : window.event;
    if (myevent.keyCode==96)
    EnableRightClick = 1;
    return;
    }
    document.oncontextmenu = mischandler;
    document.onkeypress = keyhandler;
    document.onmousedown = mousehandler;
    document.onmouseup = mousehandler;
    //-->
    </script>

  • #6
    New Coder
    Join Date
    Jun 2010
    Posts
    37
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by teedoff View Post
    Well this code here seems to block users from right clicking. Havent tested it but if thats all you want to do then try it out. I think you would have to put the code IN the iframe you want to manipulate.

    Code:
    Wanna bet?
    
    enter this script into the head of your document
    
    
    <SCRIPT LANGUAGE="Javascript"><!--
    var isNS = (navigator.appName == "Netscape") ? 1 : 0;
    var EnableRightClick = 0;
    if(isNS) 
    document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
    function mischandler(){
    if(EnableRightClick==1){ return true; }
    else {return false; }
    }
    function mousehandler(e){
    if(EnableRightClick==1){ return true; }
    var myevent = (isNS) ? e : event;
    var eventbutton = (isNS) ? myevent.which : myevent.button;
    if((eventbutton==2)||(eventbutton==3)) return false;
    }
    function keyhandler(e) {
    var myevent = (isNS) ? e : window.event;
    if (myevent.keyCode==96)
    EnableRightClick = 1;
    return;
    }
    document.oncontextmenu = mischandler;
    document.onkeypress = keyhandler;
    document.onmousedown = mousehandler;
    document.onmouseup = mousehandler;
    //-->
    </script>
    Ohh, okay yeah i was thinking that to put it in the iframe would be that simple? anyways, thanks. ima try it out soon.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •