Results 1 to 1 of 1

Thread: Iframe won't stop dragging..unbind hasn't worked..any ideas?

  1. #1
    Join Date
    Jul 2013
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Iframe won't stop dragging..unbind hasn't worked..any ideas?

    Greetings, Dec 17th, 2015

    I have a page which utilizes an include to create and iframe which as well loads a page into the iframe!..the loaded page has a couple of iframes! using the below code I can now reference the parent to move the iframe that often acts erraticaly with the below code! The problem? how to unbind the iframe so the scrollbars, select boxes can be scrolled without moving the entire iframe...any ideas?
    Code:
    function drag_frame(drg){
    var frameref=document.getElementById('spellcheck10frame');
    var $frame=$(frameref);
    //if(document.getElementById('move_bar').style.cursor=='move'){
    	
    mouse_over = false;
    mouse_position = null;
    mouse_position2 = null;
    
    $frame.contents().bind("mousedown", function(e){
        mouse_over = true;
        mouse_positionx = e.pageX;
        mouse_positiony = e.pageY;
    
    });
    
    $frame.contents().bind("mouseup", function(e){
        mouse_over = false;
    });
    
    $(document).bind("mousemove", function(e) {
       // $("#result").html("x:" + e.pageX + ", y:" + e.pageY);
    });
    
    $frame.contents().bind("mousemove", function(e) {
        if (mouse_over == true){
    
            var x=$frame.offset().left+(e.pageX) - mouse_positionx;
            var y=$frame.offset().top+(e.pageY) - mouse_positiony;
    
            //$("#result").html("x:" + (e.pageX) + ", y:" + e.pageY);
            ////$("#spellcheck10frame").css({"left" : x});
            ////$("#spellcheck10frame").css({"top" : y});
            $(frameref).css({"left" : x});
            $(frameref).css({"top" : y});
            
        }
    });
    
    //}
    //function
    }
    Last edited by Beverleyh; 12-15-2015 at 05:33 AM. Reason: Formatting

Similar Threads

  1. Iframe won't drag...any ideas?...
    By tedteeter in forum JavaScript
    Replies: 1
    Last Post: 12-13-2015, 10:44 AM
  2. I Can't get into the iframe?....any ideas?
    By tedteeter in forum JavaScript
    Replies: 1
    Last Post: 11-24-2013, 01:27 PM
  3. Resolved unbind bind button click
    By ggalan in forum JavaScript
    Replies: 1
    Last Post: 02-12-2012, 09:28 PM
  4. javascript not worked in IE.
    By j_admin in forum JavaScript
    Replies: 1
    Last Post: 03-20-2010, 04:05 PM
  5. IE mouse dragging in iframe
    By jamiller in forum HTML
    Replies: 5
    Last Post: 05-13-2007, 02:32 AM

Bookmarks

Posting Permissions

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