OnClick event
-
Hi there Sayful
Really nice and simple plugin. Does just what it needs to. Looking forward to future updates and hoping to contribute more.
Just want to know – Is there a way to add onClick events to the links in the carousel for tracking purposes? (Similar to the ‘open in new window’ post)
So if the output rendered code is this:
<div class="owl-wrapper-outer"> <div class="owl-wrapper" style="width: 5760px; left: -1080px; display: block;"> <div class="owl-item" style="width: 180px;"> <div class=""> <a href="/what-we-do/#a"><img src="/wp-content/uploads/image1.png"></a> </div> </div> <div class="owl-item" style="width: 180px;"> <div class=""> <a href="/what-we-do/#b"><img src="/wp-content/uploads/image2.png"></a> </div> </div> <div class="owl-item" style="width: 180px;"> <div class=""> <a href="/what-we-do/#c"><img src="/wp-content/uploads/image3.png"></a> </div> </div> </div> </div>
I would like it to be this rather:
<div class="owl-wrapper-outer"> <div class="owl-wrapper" style="width: 5760px; left: -1080px; display: block;"> <div class="owl-item" style="width: 180px;"> <div class=""> <a onclick="ga('send', 'event', 'feature carousel on homepage', 'button a clicked');" href="/what-we-do/#a"><img src="/wp-content/uploads/image1.png"></a> </div> </div> <div class="owl-item" style="width: 180px;"> <div class=""> <a onclick="ga('send', 'event', 'feature carousel on homepage', 'button b clicked');" href="/what-we-do/#b"><img src="/wp-content/uploads/image2.png"></a> </div> </div> <div class="owl-item" style="width: 180px;"> <div class=""> <a onclick="ga('send', 'event', 'feature carousel on homepage', 'button c clicked');" href="/what-we-do/#c"><img src="/wp-content/uploads/image3.png"></a> </div> </div> </div> </div>
Please advise?
Thanks in advance
Yatish
- The topic ‘OnClick event’ is closed to new replies.