FeRo Posted March 17, 2013 Share Posted March 17, 2013 Hi! So this is the situation:I've got a window-wrap and inside it I have a window. I want to make the window-wrap draggable, but not the window. Now I guess the window inherits the draggable from the window-wrap, so I tried to turn it off but it doesn't work... This is what I got: $(".window_wrap").draggable({containment: '#screen'}); $(".window").draggable("disable"); Link to comment Share on other sites More sharing options...
justsomeguy Posted March 18, 2013 Share Posted March 18, 2013 If you make an element draggable then it includes all of the element's children when you drag it. It doesn't drag just the one element, it drags the element and everything inside it. If you don't want the other element to drag then move it outside of the draggable one. Link to comment Share on other sites More sharing options...
FeRo Posted March 18, 2013 Author Share Posted March 18, 2013 I want that if you click on the window_wrap both elements get moved, but if you click on the window itself nothing moves (similar to a browser window). Link to comment Share on other sites More sharing options...
justsomeguy Posted March 18, 2013 Share Posted March 18, 2013 I see. You want to stop the click event from propagating if you click on the window. $("#window").click(function(event){ event.stopPropagation();}); 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now