Forum Moderators: open

Message Too Old, No Replies

How to put Draggable JQuery in front of Slideshow images?

newbee to JS and JQuery

         

gusjun

8:47 am on Aug 27, 2009 (gmt 0)

10+ Year Member



i have look at some site in which they use a dragable JQuery in front of Slideshow images. Is anyone can help me how to make a script like that? Thank you :)

gusjun

9:12 am on Aug 27, 2009 (gmt 0)

10+ Year Member



For your kind interest, this is the code for the dragable script:

<!doctype html>
<html lang="en">
<head>
<title>jQuery UI Draggable - Revert position</title>
<link type="text/css" href="theme/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript" src="ui/ui.core.js"></script>
<script type="text/javascript" src="ui/ui.draggable.js"></script>
<style type="text/css">
#draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
</style>
<script type="text/javascript">
$(function() {
$("#draggable").draggable({ revert: true });
});
</script>
</head>
<body>
<div class="content">

<div id="draggable" class="ui-widget-content">
<p>Your content here</p>
</div>

</div><!-- End content -->

</body>
</html>

Is it possible to put that script above or in front of slideshow script? So i can drag the text content to showing the Slideshow. Thank a lots and any help would be really appreciated. :)

gusjun

6:38 am on Sep 8, 2009 (gmt 0)

10+ Year Member



is there anybody can help me with this issue? or is it the wrong place to ask a question like this?

whoisgregg

1:51 pm on Sep 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello gusjun,

This is the right place to ask this type of question. :)

Have you tried implementing that code? I'm not personally familiar with jQuery (more of a Prototype/Scriptaculous fan myself). If you are trying to have more than one effect on the same page you should be able to simply include both sets of code.

If however, you are trying to merge two different effects together, then it will take some coding to get it to all play nice together.

Hopefully someone with jQuery experience can chime in. :)

gusjun

7:55 am on Sep 10, 2009 (gmt 0)

10+ Year Member



Dear Whoisgregg,

Thank you for your kind response.
Yes i'm trying to have more than one effect on the same page and already tried to implementing that code. Right now i have find a solution for that matter so this time the multiple effect were working properly although there is something weird happen on it. For that issues, i hope you can help me with that. Is it possible for me to put that code in this forum? in which the merge code were working properly but still need some touch in their code to work perfectly. If it is possible for me to put the two different code here, then i will put it immediately so we can share this code to make it more perfect in the distant future. Thank you for your kind attention and great consideration, will look forward to hear from you. :)

lexipixel

5:05 pm on Sep 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No reason you can't chain multiple JS events.

Lets say you have a div with the id "mypic1".

<div id="mypic1"></div>

In the script part of your page, use:

$("#mypic1").draggable( { options... });

Then you'd need a droppable target and in the code for it you could use the "drop: ..." option to tell the script what to do after the draggable is dropped.

$("mytarget1").droppable({
drop: function(event, ui) { // your code here });
});

I suggest reading through the Jquery UI docs about draggable and droppable.

See: [jqueryui.com...]

gusjun

8:57 am on Sep 14, 2009 (gmt 0)

10+ Year Member



Dear Lexipixel,

Yes i can put the JQuery in front of my slide show script as i already did in my last project. If you curious with that, please kindly open this url: <snip>
at there i put the slide script as a 'background' and then i put the JQuery draggable and droppable in front of it.
Please kindly check that url and i do really appreciate if you can help me to make that script more perfect.
Thanks a lots for your support.

[edited by: eelixduppy at 2:20 pm (utc) on Sep. 14, 2009]
[edit reason] no personal URLs, please [/edit]