Solved

Lightbox (prototype.js) to open on right mouse click

Posted on 2011-03-08
6
887 Views
Last Modified: 2012-05-11
Hi,

jquery currently doesn't work on my website (conflict with existing script), so I need a lightbox (prototype.js I guess) script to be opened when someone uses the right mouse click on my website. This is to prevent users from copying image address - in lightbox there will be code how to embed particular image elsewhere (therefore the lightbox needs to support html).

I like this script: http://www.artviper.net/bumpbox-demo/index.html , however I don't know how to fire it on right mouse click.


Thanks
Tom
0
Comment
Question by:jhmplondon
  • 4
  • 2
6 Comments
 
LVL 11

Expert Comment

by:Bruce Smith
ID: 35075146
...conflict with existing scripts...
What do you mean? Do you already have a jQuery plugin and you want to add another one? Are you using Joomla or something?

You can have as many jQuery plugins on one page that you want. You just have to make small mods. Post some code and I'll help you out.
0
 

Author Comment

by:jhmplondon
ID: 35075457
Nope, I have custom made website, but I think it uses prototype.js (not sure about it - can't see it anywhere included on the website).  If I inculde jquery library some parts of my website stop working like this star rating for example:

<div class="ratingRate" id="userRating">
					<a href="#" onclick="return rate(<?php echo $iv->image['id'];?>,1);" onmouseout="sr('userRating',0);" onmouseover="sr('userRating',1);"></a>
					<a href="#" onclick="return rate(<?php echo $iv->image['id'];?>,2);" onmouseout="sr('userRating',0);" onmouseover="sr('userRating',2);"></a>
					<a href="#" onclick="return rate(<?php echo $iv->image['id'];?>,3);" onmouseout="sr('userRating',0);" onmouseover="sr('userRating',3);"></a>
					<a href="#" onclick="return rate(<?php echo $iv->image['id'];?>,4);" onmouseout="sr('userRating',0);" onmouseover="sr('userRating',4);"></a>
					<a href="#" onclick="return rate(<?php echo $iv->image['id'];?>,5);" onmouseout="sr('userRating',0);" onmouseover="sr('userRating',5);"></a>
				</div>

Open in new window


I just know that once I include jquery in my page header, parts of my website stop working, so I can't use jQuery, therefore I'm looking for prototype/mootools lightbox which can be fired once someone presses right mouse button.
0
 
LVL 11

Assisted Solution

by:Bruce Smith
Bruce Smith earned 125 total points
ID: 35075519
This short article should alleviate your issue: http://docs.jquery.com/Using_jQuery_with_Other_Libraries
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 11

Expert Comment

by:Bruce Smith
ID: 35075522
Basically, include the noConfilcts() call and use "jQuery" as opposed to "$" in you jQuery code.
0
 

Author Comment

by:jhmplondon
ID: 35075575
Ok, I didn't try it yet, however I'm surprised one can use these two libraries together! Thanks a lot. I'll try this solution.

Now how about to fire onclick action with jquery if someone presses only right mouse button over the element?
0
 
LVL 11

Accepted Solution

by:
Bruce Smith earned 125 total points
ID: 35075667
You'll have to add the something like the following after in the document.ready section:
 
$([selector]).mousedown(function(e) {
    if (e.which === 3) {
        // do your onclick action here...

    }
});

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now