Is it possible to show different content on right click?

57 views
Skip to first unread message

Soy Yo

unread,
May 8, 2013, 6:27:20 AM5/8/13
to fanc...@googlegroups.com

I use Fancybox + Ajax on my website to display form to send instant messages. Sometimes users have javascript disabled or they use right click on "Send message" to open form in a new window/tab. When they do it, Ajax content opens without any formatting (css file and header/footer is not included) and they can not send message.

Is there any way how to show a different content if user uses right click? Is it possible to send some variable to the script messageform.php (my example) only in case if user uses left click, so that script can include header/footer if call does not contain this variable?

I hope you understand what I mean. I just want that Fancybox script in case of Ajax sends an variable do the called php script so that it can know that request is coming via Fancybox.

Thanks.


$(".sendmessage").fancybox({
'autoDimensions' : true,
'transitionIn'  : 'none',
'transitionOut' : 'none',
'autoScale' : false,
'onComplete': function() {$("#fancybox-inner").css({'overflow-x':'hidden'});}, 
'ajax' : {
cache : false
}});

<a class="sendmessage" href="/messageform.php">Send message</a>

PDM PDM

unread,
May 15, 2013, 5:27:27 AM5/15/13
to fanc...@googlegroups.com
anyone?

Soy Yo

unread,
May 22, 2013, 5:17:08 AM5/22/13
to FancyBox
I have posted this question inn several forums but didn't get any
answer. Maybe people just don't understand what I want to achieve.

I want that Fancybox in case of Ajax type adds additional variable to
each URL.

For example, this link opens a form to send a message (Fancybox, Ajax
type).

<a class="ajaxForm" href="/message.php?uid=18564">Send message</a>

I want Fancybox script to add an additional variable to this link:
&fancybox=1. So, Fancybox should call the following URL:

/message.php?uid=18564&fancybox=1
instead of
/message.php?uid=18564

I am not a javascript expert but I think that it's possible. It's
necessary to add &fancybox=1 somewhere in Fancybox script where it
calls requested URL. Something like:

href + '&fancybox=1

In case if user uses right click or has disabled javascript, the
request will come without &fancybox=1 and message.php will know that
it.

I just don't know what I need to modify in Fancybox script.

Any help?

Soy Yo

unread,
Jul 4, 2013, 6:18:09 AM7/4/13
to fanc...@googlegroups.com
As I see, my question is being ignored. I am willing to pay some money to somobody who can change this script so that on right click it opens a different content (in case of ajax).

You can see something similar in Facebook. Left click on a thumbnail opens photo in a box similar to Fancybox. Right click on the same thumbnail opens image in a normal Facebook page.


Reply all
Reply to author
Forward
0 new messages