User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 330,339 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,716 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 233 | Replies: 2
Reply
Join Date: May 2008
Location: kansas
Posts: 9
Reputation: fluffythebunny is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
fluffythebunny fluffythebunny is offline Offline
Newbie Poster

Javascript moving stuff

  #1  
5 Days Ago
I was going to take a look at learning ajax.
Using php but my server doesn't support php.
I used sql and asp access 2000. From 97-00.
Got so burnt out I didn't touch another computer
Until feb 2007.

So anyway back to javascript then.
I have this script that I put together.
It moves objects by getElementById.
By modifing a few variables. It can be
divided up into different functions.
Stored as js files.

Not sure how to post code here so.
Right click for source. Sorry.

Wanting to know how cross browser this code is.
http://www.stupidharold.com/dani/flyinghorse.htm
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2006
Posts: 42
Reputation: Luckychap is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 6
Luckychap Luckychap is offline Offline
Light Poster

Re: Javascript moving stuff

  #2  
5 Days Ago
Use YUI lib (http://developer.yahoo.com/yui) for modifing parametes, becoze yahoo developers already had done this for us. So read the Dom API(http://developer.yahoo.com/yui/docs/module_dom.html) in YUI. I have used it and checked it on IE, Firefox, safari, opera
Reply With Quote  
Join Date: May 2008
Location: New Zealand
Posts: 12
Reputation: Mohan0704 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Mohan0704's Avatar
Mohan0704 Mohan0704 is offline Offline
Newbie Poster

Re: Javascript moving stuff

  #3  
3 Days Ago
I recommend you look at this.
Yes, you can drag items (pictures, layers, DIVs) anywhere onto the page by using this cool script:

1. put this in your webpage:
  1. <style type="text/css">
  2. .drag{
  3. position:relative;
  4. cursor:hand;
  5. z-index: 100;
  6. }
  7. </style>

2. Once the script is installed, enabling any image on the page to be dragable is a snap.
Just put 'class="drag"' to any image, div, or even text!
For example:

  1. <html>
  2. <head>
  3. <!--drag code installed here-->
  4. </head>
  5. <body>
  6. <img src="test.gif" class="drag"><br>
  7. <img src="test2.gif" class="drag"><br>
  8. <h1><b class="drag">"Hi there</b></h1>
  9. </body>
  10. </html>

Look at this important message:
for images, put 'class="drag"' anywhere in the tags. (except at the closing tag)
for text, put it in the most innermost element, in this example, the 'b' tag, not the 'h1' tag.
Last edited by peter_budo : 3 Days Ago at 12:12 pm. Reason: Keep It Organized - please use [code] tags
I give people ideas, not answers.
It's a common answer.
That's a idea to think on.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Marketplace (Sponsored Links)
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 9:18 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC