JQuery :: Drop Target From Dragable?
Oct 24, 2011
In my sortable, i have a placeholder element which says "Please drag somethign here". After the user has done that, it should disappear, but just, if the draged item was droped into that specific list. And that's my problem. I don't know, how to check, where the dragable was droped. :/ I couldn't find anything in the event object or docs but probably it's quite easy.Of course, i could save the state of the list and then check it or something like that but that sucks.Here's my current code, it just deletes the placeholder but even if you drop the dragale into nowhere.[URL] 2nd I didn't investigate this too much but since im opening a new thread...The html element i drag around, should get wraped with a tr abd td. How do i achieve that?
When having e.g:
<table id="x">
<tr>
<td>
[code]....
and i do $("#x").remove(); it seems to remove the content and the table element but not its td's and tr's, why?why is draggable->stop: triggered on page load?If i have e.g. stop: alert("hi")i'll get a alert hi. if i put it in an external function the same, but if i do $('.draggable table').draggable({disabled: true};); nothing happens on page load, like i'd expect. why?
View 1 Replies
ADVERTISEMENT
Mar 2, 2007
I was wondering if there any examples out there that create a Draggable ifram
that display another URL in it. In this iFRAME before loading the URL it
will display a progress bar once the url has loaded the progress bar will
disappear.
View 1 Replies
View Related
Oct 27, 2009
I have some images that I want the user to be able to move around the page. So far, this script in the header allows me to do this:
var ie=document.all;
var nn6=document.getElementById&&!document.all;
var isdrag=false;
var x,y;
var dobj;
function movemouse(e){
if (isdrag){
dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
dobj.style.top = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
return false;
} }
function selectmouse(e) {
var fobj = nn6 ? e.target : event.srcElement;
var topelement = nn6 ? "HTML" : "BODY";
while (fobj.tagName != topelement && fobj.className != "dragme"){
fobj = nn6 ? fobj.parentNode : fobj.parentElement;
}
if (fobj.className=="dragme"){
isdrag = true;
dobj = fobj;
tx = parseInt(dobj.style.left+0);
ty = parseInt(dobj.style.top+0);
x = nn6 ? e.clientX : event.clientX;
y = nn6 ? e.clientY : event.clientY;
document.onmousemove=movemouse;
return false;
}}
document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");
The body has this:
<img src="images/balloons.gif" class="dragme">
Now, to be able to use this image as a link, I would have to find the displacement between the mousedown and mouseup coordinates. If the displacement is below say 10px, then the mouseup would bring them to another page. I also wanted to make it so that if the mouseup occurs in a certain area of the page, that the image would move itself to a certain spot.
View 9 Replies
View Related
May 23, 2007
I'm really loving the user-friendlyness of sites that allow movable/drag-and-drop content in little containers that can be manipulated to their preferences.
E.g:
http://www.google.co.uk/ig?hl=en
http://www.start.com/3/
http://www.eurogamer.net/gamers
MSN Spaces/Live.com
...etc
I was wondering how to go about doing this - any useful tutorials/suggestions would be great, many thanks. Not too sure what to search for.
View 2 Replies
View Related
Jun 24, 2010
Go to this site [url] then click on login in the upper right corner, and try to drag the div by click and dragging on the top of the div.
For some reason it works only when dragging to the right and up and down, but when you drag to the left, the mouse slowly gets out of the div.
The css of the login form is:
And the javascript for it is:
What i want is the same effect as if u would drag a windows application.
View 3 Replies
View Related
May 19, 2011
i want to submit form data from the popup window, close the popup, and load in the main window. problem is, it always opens a new 'tab'. i'm using google chrome, i didn't think to try this in
in the <head> of the 'main' window:
<script language='javascript' type='text/javascript'>
window.name='main';
</script>
[Code]....
View 4 Replies
View Related
Mar 24, 2011
I am using the following javascript on the target page to open it as top location from within an iframe, which is working ok.
<script type="text/javascript">
if(self!=top) {
top.location.href=location.href
}
</script>
However my problem occurs when the user uses the browsers back arrow to return to the previous page, the script executes again returning them once more to the page they have come from. Is anyone aware of a work around to this problem as it would seem there isn't one? perhaps even a better solution for opening the target page from the iframe as top location. This is really causing confusion for users, and I really need to get the issue fixed.
View 2 Replies
View Related
Oct 25, 2011
I am asking jQuery to tell me which drop down option is selected in a drop down list - like this:
I would like to check if this was successful before I proceed. What are the possible return values for this statement?
If no id exists.
If no option is selected.
If some other problem occurred.
In these cases am I expecting a null return; an undefined return, a false return value?
And, based upon the complete set of return possibilities, what would be the best and most comprehensive tests I could apply to cover every base.
View 4 Replies
View Related
Nov 4, 2011
i'm having with a superfish menu i have tried to add to my wordpress site.The menu seems to work fine for the base-level (top parent pages) menu items.But the drop down menus seem to flash on screen for just a second and then disappear when the mouse hovers over the menu items.To see an example, please check out the top menu on this temporary development page: http:[url].....I have tried adjusting the z-index in superfish.css file but it doesn't seem to be having any effect.
View 1 Replies
View Related
Nov 19, 2011
I am implementing auto re-order drop down values in asp.net. My requirement is something: I have five drop down and each has populated using 1 to 5 values. when I changevalue from dropdown, other drop down values(numberordering)should change automatically.
View 1 Replies
View Related
Oct 3, 2010
I created a drop down menu for my search bar on my website using JQuery / hover intent..The drop down is activated by the user hovering over a button, and inside there are twocombo boxesand acheck box.If the user tries to choose an option in the combo box, thedrop downdisappears..Chrome, Safari, Opera and FireFox are working fine, but IE7 + 8 have this problemI have uploaded an image of the drop down with the combo box, it is a print screen of itworkingin Chrome--> The second image is where the bug happens in IE
View 2 Replies
View Related
Oct 9, 2011
I want to know what div id I clicked on. My code looks like this:
[Code]...
I want to just know what the value of the div id is, in this case it would be "elem1". I saw .nodeName returns "div" but there's no .idName.
View 1 Replies
View Related
Jan 10, 2011
I have been searching for a long time but have been unsuccessful on how to develop a drop down menu but have the menu items show in a list above the main nav. Not below. I really like the way this functions:[URL].. But I would like the item in the list to appear above the main nav so it animates up not down. Can anyone help me on how to alter this js code to perform this task?
Here is the jQuery file link:[URl].. I tried going through this js file but it very complex. Can anyone tell me what I need to change to have the animation roll up instead of down?
View 2 Replies
View Related
Aug 26, 2010
As I work on a complex navigational menu (complex as in lots of pages and categories) I am trying to figure out how to extract the numerical part of the triggering div's id and then attach it to events within the code, thus using one set of code for multiple menu pairs. A snippet of code is below to show all the uses of the numerical part (using the jDiv plugin from Skyrocket Labs).
var hide01 = false;
$("#nav1").hover(function(){
if (hide01) clearTimeout(hide01);
$("#hidden1").show();
$(this).addClass("active"); } ...... etc
In general someone hovers over the #nav1 div, which in turn reveals the #hidden1 div, same for nav2 & hidden2, nav3 & hidden3, etc. Right now I am simply duplicating the code for each pair, but it would be nice to figure out how to use variables and reduce code size. I understand it is possible to perhaps get the numerical part using
$(this.id).replace('nav','')
But haven't figured out how to attach it to the various values within the code (hide, #nav, #hidden).
View 2 Replies
View Related
Jul 7, 2009
I have the following code
$('.box').hover(
function(){ $(this).css('background-color','#6bc6f2'); $("p").css('color','#fff') },
function(){ $(this).css('background-color','#fbf9f9'); $("p").css('color','#000') }
);
I have the .box class applied to a div basically I what to hover over the div change the background color of the div and at the same time change the text color of any text wrapped in p tags.
I am getting close but with this code every instance of the p tag gets swapped out I need to know how to target only p tags in the div that I am mouseing over
View 3 Replies
View Related
Mar 23, 2011
I'm trying to target an element to highlight it when I roll hover on a a tag list (which is a result of ajax request)[code]...
View 5 Replies
View Related
May 18, 2009
I have a func:
$('div.tabnav ul.tabNavigation a').click(function () {
this.hash e.t.c
//Is there a way to find out the name of the div or jquery id that was clicked. E.G so I can go ( in pseudo )
[Code].....
View 1 Replies
View Related
Mar 3, 2011
I'm in the midst of some volunteer work for my local roleplaying community, creating their website. I want to use a menu bar in the top with a <ul> and simple "a href"'s to switch between the main content. The content of each 'page' will be retrieved from a phpBB board using php.
I've chosen jQuery because I want to learn more about it and have stumpled upon this problem: How do I target a div, show that, and then hide the current one (or simply all other divs with a certain class). Maybe it has to be done the other way around, hide and then show, to prevent the page from being displayed in a weird way while they're swapping place.
If possible, I would also like to only load the content of the content divs when the menu button is clicked, so it doesn't take load time at first.
View 4 Replies
View Related
Mar 13, 2010
I am trying to set some styles for an iFrame contained within a div. I know the div's id but the iFrame has no id. What is the proper way to target the iFrame?
View 3 Replies
View Related
Jan 26, 2010
i'm using slideToggle which reveals a large element upwards;
[URL]
Given that the element revealed is very high the anchor tag that is used to show/hide sometimes disappears. I've tried return false; but that doesn't fix it
View 1 Replies
View Related
Jul 15, 2011
Using a pikachoose slideshow inside an iframe and for some reason adding a url target of _top or _parent is not working. It just opens up the link in the iframe window no matter what i do.
I'm working on it in the staging area of my site- [url] You can see when you click on one of the images it doesnt fill the entire window.
View 4 Replies
View Related
May 18, 2010
I am able to get the page to scroll using something like this
$("html:not(:animated),body:not(:animated)").animate({ scrollTop: rw_X, scrollLeft: rw_Y},2000);
I was hoping to be able to target the animate element by using something like this
document.body Is this not possible? What are some targets that allow you to scroll the page (the position of the scroll bars)?
View 2 Replies
View Related
Oct 22, 2011
I'm am trying to make a script that looks something like this:[code]This of course doesn't work. I don't no how to put the javascript variable v1 into the id selector to target the DIV with id="v1".I'm more a designer then a programmer.
View 5 Replies
View Related
Feb 22, 2010
Am having a fiddle with the following for a while now and am not getting anywhere - also not knowing if what i am trying is actually the best / fastest way... What i have is the following menu
<ul>
<li>Test</li>
<li>Test
[code].....
View 11 Replies
View Related
Jul 20, 2011
I need change the following jQuery script to target all images for a WP theme. I found two codes that may do it, but I don't know where to place them.
(sample)
Code JavaScript:
$("img[src='left1.gif']").hide();
or
event.target. As it stands now, the script doesn't load images, the browser takes over and loads the image.
(I've included the original comments in the script for safe keeping)
Code JavaScript:
jQuery(function(){
// Tabs
jQuery("#fbfwTabs").tabs();
[Code].....)
View 7 Replies
View Related
May 24, 2011
I'm pretty new to jquery. What I have is an array of images in a slideshow.
View 16 Replies
View Related