I have the following situation: There are two DIV elements that are positioned absolute at the same position and with the same dimensions. The div element a has a z-index of 10, the div element b a z-index of 20. Div element a is draggable, but div element b is not draggable.
Now I would like to change the focus after a mousedown element. If the user presses the mouse button on div element b, the focus should be on div element a so that it could be dragged away without having to stop pressing the mouse button.
Is that possible and how can I realise it? My first approach does not work:
<style type="text/css">
#elementa{position:absolute;top:0;left:0;width:50px;height:50px;z-index: 10;}
#elementb{position:absolute;top:0;left:0;width:50px;height:50px;z-index: 20;}
</style>
<div id="elementa"></div>
<div id="elementb"></div>
$('#elementb').mousedown (function(){
$('#elementb').unbind("mousemove");
$('#elementb').blur();
$('#elementb').css({'display': 'none'});
$( '#elementa').focus();
});