Welcome to TalkGraphics.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Apr 2018
    Location
    Barnes, London
    Posts
    952

    Default Variants & Placeholders - Best Practice using ID & Classes?

    Probably one for the techies here:

    I have audio and video tags on a single variant, each with a unique ID. I have functions that call those tags using getElementById() - all works well e.g. Jukebox-Waterways.xar

    The original designs for the Audio/Video plugins were always implemented as plugins (website within a website as required) - additional variants didn't feature.

    However, with some recent enhancements, I am creating a second desktop variant (from the original mobile variant using Scale-to-fit-Width extended to same width as the new desktop variant).

    Because the placeholders use IDs, AFAIK this does not work for second or subsequent variants.

    Thought it possible to add a class="username" instead of id="username" to the placeholders and then use getElementsByClassName() but I am not sure how this plays out across Xara variants.

    Guidance much appreciated.

    Gary

    BTW using separate IDs fixes the issue, but doubles up on the code
    Last edited by Initiostar; 05 August 2021 at 05:21 PM. Reason: Separate IDs test

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •