Moving Objects (Not sure if this goes here)

This is a discussion on "Moving Objects (Not sure if this goes here)" within the JavaScript Forum section. This forum, and the thread "Moving Objects (Not sure if this goes here) are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old May 11th, 2008, 19:53
Stormraven's Avatar
SuperMember

SuperMember
Join Date: Feb 2006
Location: $_home
Age: 19
Posts: 158
Thanks: 3
Thanked 1 Time in 1 Post
Thumbs down Moving Objects (Not sure if this goes here)

Sorry if this is not the right place to post this but, but on the www.bbc.co.uk website if you put your mouse over the topic titles it allows you to move them about and im assuming it stores a cookie to tell where its been moves to how can i do that too? im not sure how to code it, im assuming its PHP i think

does anyone know of a code or can someone help me achieve this please?

By the way at the moment im using Xampp >.<

Last edited by Stormraven; May 11th, 2008 at 20:00.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old May 11th, 2008, 20:18
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,269
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Moving Objects (Not sure if this goes here)

Moved to the Javascript Forum

You'll need javascript for this. (PHP mixed in to store where the object was dragged to.) Javascript libraries such as MooTools and JQuery that have drag-and-drop built in.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old May 11th, 2008, 20:34
Stormraven's Avatar
SuperMember

SuperMember
Join Date: Feb 2006
Location: $_home
Age: 19
Posts: 158
Thanks: 3
Thanked 1 Time in 1 Post
Re: Moving Objects (Not sure if this goes here)

It says page not found >.<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old May 11th, 2008, 20:38
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,269
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Moving Objects (Not sure if this goes here)

oops

http://www.mootools.net/ http://www.jquery.com/
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old May 11th, 2008, 20:48
Stormraven's Avatar
SuperMember

SuperMember
Join Date: Feb 2006
Location: $_home
Age: 19
Posts: 158
Thanks: 3
Thanked 1 Time in 1 Post
Re: Moving Objects (Not sure if this goes here)

I cant see anything on those pages that move things around though mate
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old May 11th, 2008, 21:26
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,269
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Moving Objects (Not sure if this goes here)

You gotta look harder

http://demos.mootools.net/DragDrop

http://docs.jquery.com/UI/Droppables
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old May 11th, 2008, 21:42
Stormraven's Avatar
SuperMember

SuperMember
Join Date: Feb 2006
Location: $_home
Age: 19
Posts: 158
Thanks: 3
Thanked 1 Time in 1 Post
Re: Moving Objects (Not sure if this goes here)

Right im testing this code in xampp:

Code: Select all
<html>
<head>
<title>Script test</title>
</head>

<body>
<h3>Group waits till all Ajax requests are done.</h3>
<a id="req-start" href="#">Start Requests</a>
<dl id="req-states">
    <dt>Request #1:</dt>
    <dd id="req-state-1">-</dd>
    <dt>Request #2:</dt>
    <dd id="req-state-2">-</dd>
    <dt>Request #3:</dt>
    <dd id="req-state-3">-</dd>
    <dt>Request #4:</dt>
    <dd id="req-state-4">-</dd>
    <dt>Request #5:</dt>
    <dd id="req-state-5">-</dd>
    <dt>Request #6:</dt>
    <dd id="req-state-6">-</dd>
    <dt><strong>OVERALL:</strong></dt>
    <dd id="req-state-all">-</dd>
</dl>

<script type="text/css">
#req-states dt
{
    width: 100px;
    float: left;
}
#req-states dd
{
    padding-left: 20px;
    margin-left: 20px;
}
#req-states dd.ajax-loading
{
    margin-left: 80px;
    background:    url(http://demos.mootools.net/demos/Group/spinner.gif) no-repeat 0 0;
}
 
.tool-tip {
    color: #444;
    background-color: #eee;
    width: 300px;
    z-index: 13000;
}
 
.tool-title {
    font-weight: bold;
    font-size: 11px;
    margin: 0;
    color: #222;
    padding: 8px 8px 4px;
}
 
.tool-text {
    font-size: 11px;
    padding: 4px 8px 8px;
}
</script> 

<script type="text/javascript">
<!--
var url = 'http://demos.mootools.net/demos/Group/lipsum.html?antiCache=';
var id = 0;
var tips = new Tips();
 
/**
 * reqState is a custom option, onRequest/onComplete can handle
 * it like a property. Its used here to take track of the element
 * for the specific Ajax requests.
 * 
 * We define options here because it saves code and all
 * Ajax instances have the same options. We also add a Tips::build
 * to show the responseText
 */
 
var options = {
    method: 'get',
    onRequest: function(){
        this.options.reqState
            .addClass('ajax-loading')
            .setHTML('Request ...');
    },
    onComplete: function(resp){
        this.options.reqState
            .removeClass('ajax-loading')
            .setProperty('title', 'Response: :: ' + resp)
            .setHTML('Complete!');
        tips.build(this.options.reqState);
 
    }
};
 
/**
 * a for loop here would be easier, but its better that way so you can
 * see whats in xhrs: 6 Ajax instances
 * 
 * The id is appended as url-parameter to prevent caching.
 */
var xhrs = [
    new Ajax(url, $merge({reqState: $('req-state-' + (++id))}, options)),
    new Ajax(url, $merge({reqState: $('req-state-' + (++id))}, options)),
    new Ajax(url, $merge({reqState: $('req-state-' + (++id))}, options)),
    new Ajax(url, $merge({reqState: $('req-state-' + (++id))}, options)),
    new Ajax(url, $merge({reqState: $('req-state-' + (++id))}, options)),
    new Ajax(url, $merge({reqState: $('req-state-' + (++id))}, options))
];
 
/**
 * The group, it has one Event that waits for all Ajax instances to finish
 * it: onComplete. When all requests are complete this onComplete is fired.
 */
var group = new Group(xhrs[0], xhrs[1], xhrs[2], xhrs[3], xhrs[4], xhrs[5]);
 
group
    .addEvent('onRequest', function() {
        $('req-state-all')
            .addClass('ajax-loading')
            .setHTML('All Requests started ...');
    }).
    addEvent('onComplete', function() {
        $('req-state-all')
            .removeClass('ajax-loading')
            .setHTML('All Completed!');
    });
 
/**
 * The last thing, the event which starts the request.
 */
$('req-start').addEvent('click', function(e) {
    new Event(e).stop();
 
    xhrs.each(function(xhr){
        xhr.url = url + $random(100, 999);
        xhr.request();
    });
});
//-->
</script>
</body>
</html>
im saving it as a .html and puttin it in htdocs but its not working how come
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old May 11th, 2008, 21:51
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,269
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Moving Objects (Not sure if this goes here)

First off, please don't just post the entire code, nobody is going to want to read through it. Just post the problematic parts.

The thing thats causing you trouble is that you don't include the mootools library. The browser won't know what any of the classes and functions are.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old May 11th, 2008, 21:56
Stormraven's Avatar
SuperMember

SuperMember
Join Date: Feb 2006
Location: $_home
Age: 19
Posts: 158
Thanks: 3
Thanked 1 Time in 1 Post
Re: Moving Objects (Not sure if this goes here)

How do i add the mootools library to that? im sorry about posting the whole code
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old May 11th, 2008, 21:59
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,269
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: Moving Objects (Not sure if this goes here)

http://mootools.net/download

then use

HTML: Select all
<script type="text/javascript" src="dir/dir/mootools.js"></script>
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to move the objects in HTML? virenparmar Website Planning 1 Jun 2nd, 2008 08:47
Removing objects in an array breepupetstofight ASP.NET Forum 0 Sep 17th, 2007 13:00
Sending objects to the client QuikFrozen ASP.NET Forum 5 Apr 18th, 2007 14:20
Internet Explorer & objects... HELP! brittny Web Page Design 7 Jul 6th, 2005 23:29
revolving objects benji Flash & Multimedia Forum 5 Sep 9th, 2003 11:56


All times are GMT. The time now is 03:52.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42