Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Making entire Event box a link in table view

$
0
0

Replies: 0

Hi folks,

I don’t need help, I’m offering it; I recently wanted to add the ability to click on any part of an Event box (or info popup), instead of just the title of the event. A friend who codes sent me this snippet of JavaScript to include as raw HTML at the end of any page where the timetable displays:

<script type='text/javascript'>
for (s = document.getElementsByClassName('mptt-event-container'), i = 0 ; i < s.length ; ++i)
s[i].addEventListener('click', function() { self.location = this.getElementsByTagName('h6')[0].children[0].href }) ;
</script>

Works like a charm. Enjoy!


Viewing all articles
Browse latest Browse all 59525

Trending Articles