Skip to main content

Hi all,

 

I gave some feedback to K2 to provide a section on this forum for Jquery / Javascripts which work specifically in K2, but nothing has happened.

 

So I would like to propose this Post for everyone to add their Jquery/Javascripts.

 

This could go a long way in us K2ers helping each other with scripts which give us that extra functionality that isn't quite there in K2. When googling scripts, they don't always work in K2, so if we post scripts that work 100%, this would help a lot of us out.

 

Rather than comments (create your own post about it) if we can keep this thread strictly as scripts and an explanation only, it would create less clutter.

 

Not sure if its possible, but could the mods make this a Sticky on the forum?

 

All the best

 

 

I will start the ball rolling:

 

Flashing Text (credit to DavidAerne)

 

Add this expression to a DATA Label and click Literal

 

<div id="makemeblink"><h1>This Will Blink!!!</h1></div> <script> function blinkMe(divToBlink){ if (document.getElementById("makemeblink").style.color == "blue"){ document.getElementById("makemeblink").style.color="white"; }else{ document.getElementById("makemeblink").style.color="blue"; } } window.setInterval("blinkMe('makemeblink')",100); </script>

 

 


This script allows you to set the background and borders of a table, something you can't do out of the box.

 

Create an expression with this script.

 

<script type="text/javascript">$(document).ready(function() {$("spananame='TableCSS']").closest('table').css({'border':'gray 1px solid', 'background':'#EBECE5'}).find('td').css('border','lightgray 1px solid');})</script>

 

Place a Data Label called TableCSS inside the table, set the Expression to the script expression and check the literal option. 

 

 


Reply