Title: Use token in javascript
Last modified: August 24, 2016

---

# Use token in javascript

 *  [RICH65](https://wordpress.org/support/users/rich65/)
 * (@rich65)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/use-token-in-javascript/)
 * Hello everyone!
    To view items in the CataBlog is used jQuery Colorbox (CataBlog
   lightbox is used to display a different catalog). The image in the Colorbox is
   repeated over the entire surface as on the [Backhausen website](http://www.backhausen.com/produkte/stoffkatalog/).
 * Here is the used template:
 *     ```
       <script type="text/javascript">
       function myFunction() {
       	cboxContent.style.background = "url('%IMAGE-ORIGINAL%')";
       }
       </script>
   
       <div class="catablog-row catablog-gallery">
       	<a href="%IMAGE%" title="%DESCRIPTION%" onclick="myFunction()">
       	<img src="%IMAGE-THUMBNAIL%" title="" alt="%TITLE%" /></a>
       <div class="catablog-title">%TITLE%</div>
       </div>
       ```
   
 * Javascript assigns a background to #cboxContent element in Colorbox, which is
   repeated over the entire surface.
    The problem is that the token %IMAGE-ORIGINAL%
   always assigns the Colorbox background of the last item in the catalog on the
   page. I need to assign the correct background to Colorbox (image of the selected
   item). Information images are here: [http://rich65.rajce.idnes.cz/CataBlog/](http://rich65.rajce.idnes.cz/CataBlog/)
   Anyone have any idea? Thank you for answer.
 * RICH
 * [https://wordpress.org/plugins/catablog/](https://wordpress.org/plugins/catablog/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/use-token-in-javascript/#post-6065026)
 * Hi Rich have you got a different lightbox plugin installed?
 *  Thread Starter [RICH65](https://wordpress.org/support/users/rich65/)
 * (@rich65)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/use-token-in-javascript/#post-6065062)
 * Hi.
    I use [jQuery Colorbox](https://wordpress.org/plugins/jquery-colorbox/) 
   by techotronic. CataBlog lightbox use as well, but for a different kind of catalog(
   the default template with the main picture and sub-pictures).
 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/use-token-in-javascript/#post-6065091)
 * Hi you might like to check the following [support thread](https://wordpress.org/support/topic/navigating-between-secondary-images-in-the-lightbox).
   It might give you some pointers.
 * Regards
 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/use-token-in-javascript/#post-6065254)
 * Hi, is your issue resolved?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Use token in javascript’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/catablog_f7f6f7.svg)
 * [CataBlog](https://wordpress.org/plugins/catablog/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/catablog/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/catablog/)
 * [Active Topics](https://wordpress.org/support/plugin/catablog/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/catablog/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/catablog/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/use-token-in-javascript/#post-6065254)
 * Status: not resolved