/    Sign up×
Community /Pin to ProfileBookmark

trying to modify this code

If you go here
[url]http://codelifter.com/main/javascript/dragablelayer.html[/url]

I want to have the ability to pass any layer name and make it draggable not a fixed name “theLayer”. I tried to modify the function but the code crashed.

Any ideas.

Thanks…

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@savvykmsOct 30.2007 — Original code within source:
[CODE]whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");[/CODE]
New code:
[CODE]whichDog=isIE ? document.all.yourid : document.getElementById("yourid");[/CODE]
Copy linkTweet thisAlerts:
@realtime158authorOct 30.2007 — What you have 3 layers on your page that you want to be draggable and you can hide them at the same time I don't think you can do this.

whichDog=isIE ? document.all.yourid : document.getElementById("lay1");

whichDog=isIE ? document.all.yourid : document.getElementById("lay2");

whichDog=isIE ? document.all.yourid : document.getElementById("lay3");

Thanks...
Copy linkTweet thisAlerts:
@samliewOct 31.2007 — That's because you are reusing the variable, and only the last statement will be the outcome.
Copy linkTweet thisAlerts:
@realtime158authorOct 31.2007 — How do i change the code to multiple dragable layers.

Thanks...
×

Success!

Help @realtime158 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...