- This topic has 4 replies, 2 voices, and was last updated 9 years, 1 month ago by Sakin.
-
AuthorPosts
-
July 19, 2015 at 5:39 am #61198Cesar RParticipant
Hi, on the Tactics page of my website http://chess-instructor.com, I’m using an iframe to display a javascript-based chess app.
How can I leverage your framework so that when my website is being viewed on an iphone or android device, I can display a smaller view of the app?
I was envisioning something like the following code, but it doesn’t work:
<script type="text/javascript"> var uagent = navigator.userAgent.toLowerCase(); if (uagent.search("iphone") > -1) { document.getElementById('myiframe').src = "/chess-puzzles/demo-tactic-training-280.html"; else document.getElementById('myiframe').src = "/chess-puzzles/demo-tactic-training-400.html"; } </script>
I would appreciate your guidance and assistance.
Thank you!
Cesar RJuly 23, 2015 at 10:39 am #61367SakinKeymaster@Cesar R: Sorry this is not directly related to theme and I am not aware of script that you are using to support your code. Your Tactics should have responsive embed code then it will be fine. But when I check your page, it is using fixed height and width embed code. So, you need to get help from that code provider.
July 24, 2015 at 4:56 am #61413Cesar RParticipantHi Sakin,
I don’t think I worded my question appropriately. The theme obviously has code that detects whether the website is being displayed on a mobile device.
I was wondering if there is a way to hook into that code so that I’m able to display an appropriate sized version of the tactics app?
I’m currently working on updating the code so that the app can resized or perhaps responsive.
Does that make sense?
Thanks again for your services!
August 6, 2015 at 7:57 am #62242Cesar RParticipantHi Sakin,
I was able to customize the javascript being used for the diagrams, so that it is now responsive. The diagram is looking good on all devices.
Thanks for your response as I was thinking that by customizing the theme I would be able to achieve this effect. But it is clear now I needed to adjust the diagram code.
Cesar
August 10, 2015 at 8:51 pm #62684 -
AuthorPosts
- The topic ‘Manipulate iframe src based on type of device’ is closed to new replies.