/    Sign up×
Community /Pin to ProfileBookmark

Can’t find the fault in this code

Greetings,

I’ve registered to this board specifically for this problem, though I’m beginning to suspect that I’ll be here MUCH more often.

Recently I’ve tried to add a Lightbox script to an already existing page that already had a javascript feature in it. Now I know that there’s no limit to the number of scripts you can run simultaneously, but when I added the lightbox feauture, my compiler gave me the following error:

$ is not defined
this.elements = $(this.options.thumb…lements(this.options.itemsSelector);

This line of code was part of the original source code of the page, and hadn’t been a problem before I added the Lightbox code. Why is $ undefined all of a sudden and where can I find a solution for this? Could someone point me in the right direction here? I’m not exactly a novice(yet) when it comes to Javascript and this project was due yesterday.
I’d appreciate it if you guys could help me.

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Aug 20.2010 — That's not valid JavaScript, so there's a problem with the original source-code. Where did you get that from?
Copy linkTweet thisAlerts:
@DwinnaauthorAug 20.2010 — Thanks Fang, I'm trying out your solution right now.

@Declan: The line of code I posted is from the .js file of the original index.html page (it was a template).
Copy linkTweet thisAlerts:
@Declan1991Aug 20.2010 — @Declan: The line of code I posted is from the .js file of the original index.html page (it was a template).[/QUOTE]But did you take the line from the error console? It's obviously not complete with the ellipsis in the middle.
Copy linkTweet thisAlerts:
@DwinnaauthorAug 20.2010 — But did you take the line from the error console? It's obviously not complete with the ellipsis in the middle.[/QUOTE]

Yes I did actually.

There seem to be no more conflict errors after trying and testing the methods described in Fang's link, but now the page isn't supposed to do what I originally intended it to do, which is have a javascript clickable image sidescroller, and the images themselves to pop-up in a lightbox. Now you can scroll through the images, but onClick the image just opens in a new browser window.

Could I be in over my head here?
Copy linkTweet thisAlerts:
@FangAug 21.2010 — The sidescroller is overwriting the lightbox event handler.

Perhaps another lightbox has both functions.
×

Success!

Help @Dwinna 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 6.1,
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,
)...