Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Heh no need to apologise I appreciate all the hlp your giving me. This is also not working though with the same error. Is there anywhere specific in the php file that it needs to go. I have tried inserting it after the input type's and also into <section id = "content 4"> area
Cheers
Offline
If I insert it between the opening and the function ttg_gallery_bottom it doesn't error but doesn't change the slideshow height either.
<section id="content4">
<!-- opening the gallery tab -->
';
return true;
} // END
function ttg_scripts( $style, $path ) {
echo '
<script>
$(\'input:radio[id="tab4"]\').change(function(){
if(this.checked) {
vegasAspectRatio();
}
});
</script>
';
} // END
function ttg_gallery_bottom( $style, $path ) {
echo '
<!-- closing the gallery tab -->
</section>
Offline
I would put the ttg_scripts function last, but it doesn't actually matter. I clicked on your page link, but it's a 404 error.
Offline
Sorry Matthew,
The page link has changed, my bad I should have posted the new link.
https://www.overthetopimagery.com.au/Sok
I've moved the script to the end and it seems to be working now.
Really great for all you help on this, darn awesome! And thanks to Ben and Rod for the earlier assistance.
Wicked stuff!
Cheers
Last edited by Mediahype (2017-02-07 23:00:01)
Offline
Maybe I was premature in celebrating....it works intermittanly it would appear
Offline
I see what's happening. The aspect ratio function is in an isolated scope, so we're not able to call it. We'll have to strong arm it then.
function ttg_scripts( $style, $path ) {
echo '
<script>
$(\'input:radio[id="tab4"]\').change(function(){
if(this.checked) {
var galleryWidth = $(\'.gallery\').width();
var galleryAspectRatio = 0.5625;
$(\'.gallery\').css(\'height\', galleryWidth * galleryAspectRatio );
}
});
</script>
';
} // END
Offline
That's done the trick! Once again thanks Matthew, This is awesome!!
I have a thin white line to the right and bottom of the images which I'll have to find why through the styling or slideshow template.
But this is the layout I envisaged so it's really great to get this working!!! I'm much happier without the iFrames, pym.js.
This is also great as it maintains the ability to publish the slideshow direct from Lightroom!
If you wish to see the result, I've renamed the page back to what it was originally;
https://www.overthetopimagery.com.au/Sokar
Thanks again, You Rock!
Offline
Just a thought Matthew, Could these tabs be used to insert multiple contact foms? So instead of a gallery insert a contact form?
I have 2 types of enquries with different contact forms. I was just wondering if I could setup a page with 2 tabs on it with 1 contact form under each tab?
Cheers
Offline
Glad that's working.
You can put pretty much whatever you like into a tab, though probably not using Backlight's embedded form feature. You'd have to code your own form.
The white lines around the image I think are a sub-pixel artifact from scaling the image. When the math gives you an impossible dimension, such as a height of 640.7-pixels, this is sometimes what you end up with, because a display cannot render 0.7 pixels. Maybe edit the Javascript function to round up to the nearest whole pixel?
Offline