[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2011-03-08
6
Medium Priority
?
900 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 500 total points
ID: 35075519
This short article should alleviate your issue: http://docs.jquery.com/Using_jQuery_with_Other_Libraries
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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 tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Suggested Courses

830 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