Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Fire fancybox from javascript
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: Fire fancybox from javascript
#54834
Fire fancybox from javascript 8 Years, 10 Months ago Karma: 0
We make good use of the Ari Smart Content functions. Would like to know if the following is possible.

Can we 'fire' (this means open direct) a fancybox from Javascript / jQuery?

Eg with a command like this:
Code:

$.fancybox({
  'width': '800px',
  'height': '100%',
  'url': 'http://www.google.com',
  'autoShow': '1'
});


... or something like that. If this is possible, could you give me the right syntax.

Regards.
The administrator has disabled public write access.
 
#54835
Re:Fire fancybox from javascript 8 Years, 10 Months ago Karma: 747
Hello,

If fancybox javascript and CSS files are loaded, it is possible to use the following javascript code to open the lightbox:

Code:


(window["ascJQuery"] || jQuery).fancybox.open({type:'iframe',href : 'http://www.ari-soft.com', 'width': 800, 'height': '100%'});



Regards,
ARI Soft
The administrator has disabled public write access.
 
#54836
Re:Fire fancybox from javascript 8 Years, 10 Months ago Karma: 0
Great, this works. Thanks for the fast reply (again).

Regards.
The administrator has disabled public write access.
 
#54843
Re:Fire fancybox from javascript 8 Years, 10 Months ago Karma: 0
I now encounter a problem. Maybe you can help.

When I execute the javascript command to open a pdf file in Chrome, the first time a pdf is opened it auto-fits the content to the width of the window. When I execute the command again on the same webpage to open another pdf, this pdf is not auto-fit to the window width. I get a very small image of the pdf in de Fancybox window. See image attached.

This problem only occurs in Chrome when I execute Fancybox direct from javascript. When I do the same in Firefox, every pdf is auto-fit to the size of the Fancybox window. The problem also does not occur in Chrome when several pdfs are opened using normal fancybox links on the webpage.

Is there a way to force the pdf content inside a Fancybox window to always fit to the width of that Fancybox window?

Regards.
Last Edit: 2015/06/11 09:21 By stephanbeek.
The administrator has disabled public write access.
 
#54844
Re:Fire fancybox from javascript 8 Years, 10 Months ago Karma: 747
Could you send a link to a page where the problem occurs?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#54849
Re:Fire fancybox from javascript 8 Years, 10 Months ago Karma: 0
Use for testing: test.toonkunstgouda.nl/index.php/aritest
You will see a table. Click on a table line. This will open a pdf view with the record data.
First opening of a pdf is normal. When you refresh the page the pdf opens normal again.
The administrator has disabled public write access.
 
Go to topPage: 12