Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 15. Dec 2018, 09:09

All times are UTC + 1 hour [ DST ]

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 30. Jan 2018, 04:34 

Joined: 30. Jan 2018, 03:58
Posts: 1
I am working on a website for a shelter that uses petango to display an IFrame. My shortcode looks like this:

[advanced_iframe securitykey="xxxxxxxxxxxxxxxxxx" use_shortcode_attributes_only="true" src=""xxxxxxxxxxxxxxxxx" width="100%" height="600" id="advanced_iframe" enable_responsive_iframe="true" ]

I would like to be able to detect the size of the screen and set the number of columns to 1 or 3 - ie a mobile device with small screen. Mind you I am new to javascript and web programming in general, but I thought something like this in a custom html block would work:

<script type="text/javascript">
var cols = 0;
   if($(window).width() < 400)
      cols = 1;
      cols = 3;
   return ([advanced_iframe securitykey="xxxxxxxxxxxxxxx" use_shortcode_attributes_only="true" src=""+cols.toString()+"&orderby=ID&authkey=xxxxxxxxxxxxxxxxxxxxxxxxx" width="100%" height="600" id="advanced_iframe" enable_responsive_iframe="true" ]);

but it doesn't. Any idea how I would go about this in WordPress?

PostPosted: 31. Jan 2018, 19:26 
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10955
This is not working because a shortcode is rendered on the server but Javascript on the client.
This does not work at all together.

You need to do this completely different! The plugin has an integrated browser detection in the pro version!
so you define 2 shortcodes - one for desktop and one for mobile.
check the integrated help for the browser detection.

Best, Michael

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
powered by phpbb | Datenschutz/ Privacy policy