This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var dataLayer = window.dataLayer || []; | |
var eventString = 'cusevent'; | |
var eventCategoryString = '張曼娟活動頁'; | |
var areaIndex = 0; | |
var areaIndexArr = []; | |
$(window).scroll(function() { | |
var windowHeight = $(window).height(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isScrolledIntoView(elem) { | |
var docViewTop = $(window).scrollTop(); | |
var docViewBottom = docViewTop + $(window).height(); | |
var elemTop = $(elem).offset().top; | |
var elemBottom = elemTop + $(elem).height(); | |
return (elemTop <= docViewBottom) && (elemBottom >= docViewTop); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function scrollRatio(percentage) { | |
var domHeight = Math.max( | |
document.body.scrollHeight, | |
document.body.offsetHeight, | |
document.documentElement.clientHeight, | |
document.documentElement.scrollHeight, | |
document.documentElement.offsetHeight); | |
return parseInt(window.scrollY / (domHeight - window.innerHeight) * 100 / percentage) * percentage || 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> | |
<script> | |
(function($) { | |
var dataLayer = window.dataLayer || []; | |
var eventString = 'cusevent'; | |
var eventCategoryString = '2018淡季早鳥優惠'; | |
var eventInfo = [ | |
['.pc-a-bt td:nth-child(1)', '服務按鈕點擊', '預約租車'], | |
['.pc-a-bt td:nth-child(2)', '服務按鈕點擊', '加入會員'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var dataLayer = window.dataLayer || []; | |
var eventString = 'cusevent'; | |
var eventCategoryString = '會員註冊'; | |
$('#rg_button').click(function(e) { | |
var eventInfo = [ | |
['填寫資料 - E-mail', $('#email').val()], | |
['填寫資料 - 輸入密碼', $('#passwd1').val()], | |
['填寫資料 - 輸入確認密碼', $('#passwd2').val()], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var eventCategoryString = '會員註冊'; | |
$('#email').on('change', function() { | |
pushDatalayer('填寫資料 - E-mail', $(this).val()); | |
}); | |
$('#passwd1').on('change', function() { | |
pushDatalayer('填寫資料 - 輸入密碼', '次數'); | |
}); | |
$('#passwd2').on('change', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 至少有一個字元 | |
.+ | |
// 判斷首頁 | |
\/(index\.html)?$ | |
// 符合 /a_myday/ 或 /a_myday/index.php | |
^\/a_myday/(index.php)?$ | |
// 符合 / 或 /ecshop/ | |
^\/(ecshop\/?)?$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jQuery = jQuery || undefined; | |
(function($) { | |
tdFun($); | |
function tdFun($) { | |
if ($) { | |
setEvent(); | |
} else { | |
// 載入jQ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var jQuery = jQuery || undefined; | |
(function($) { | |
var dataLayer = window.dataLayer || []; | |
var eventCategoryString = '首頁'; | |
eventFun($); | |
function eventFun($) { |
OlderNewer