File: /www/wwwroot/www.zgesad.info/sh/js/share.js
function copyUrl(type){
var sURL = window.location.href;
sTemp = "<input id = \"copyurl\" value = \"" + sURL + "\" />";
$("body").append(sTemp);
$("#copyurl").select();
document.execCommand("copy");
$("#copyurl").remove();
if(type == 'news'){
alert('此篇最新消息連結已成功複製,歡迎您分享!');
}else if(type == 'blog'){
alert('此篇美髮講座連結已成功複製,歡迎您分享!');
}else if(type == 'gallery'){
alert('此篇設計師作品連結已成功複製,歡迎您分享!');
}
}
$(function () {
$(window).scroll(function () {
var scrollVal = $(this).scrollTop();
if(scrollVal > 100){
$("#article_conshare").show();
}else if(scrollVal < 100){
$("#article_conshare").hide();
}
});
});
$('.article_consharebtn').click(function(event){
event.stopPropagation();
if($('.article_conshare-fix').css("left")=="-50px"){
$('.article_conshare-fix').animate({left:"0px"});
}
else{
$('.article_conshare-fix').animate({left:"-50px"});
}
});
/*function updateClickNum(field_name, id, url) {
$.ajax({
type: "POST",
url: "/"+ url +"/click_num",
'data' : {
'field_name' : field_name,
'id' : id,
},
success: function(info) {
if(field_name == 'line_see_num'){
if($('#browser').val() == 'line'){
location.href = 'http://line.naver.jp/R/msg/text/?'.concat(encodeURIComponent(location.href));
}else{
window.location.reload();
var w = window.open('https://social-plugins.line.me/lineit/share?url='.concat(encodeURIComponent(location.href)));
}
}else if(field_name == 'fb_see_num'){
if($('#browser').val() == 'line'){
location.href = 'http://www.facebook.com/share.php?u='.concat(encodeURIComponent(location.href));
}else{
window.location.reload();
var w = window.open('http://www.facebook.com/share.php?u='.concat(encodeURIComponent(location.href)));
}
}
}
});
}*/
/* 更新分享次數 */
$('.updateClickNum').click(function() {
var id = document.getElementById("id").value;
var url = document.getElementById("table").value;
var browser = document.getElementById("browser").value;
if($(this).attr("id") == 'fb_click_num_1' || $(this).attr("id") == 'fb_click_num_2'){
var field_name = 'fb_see_num';
}else if($(this).attr("id") == 'line_click_num_1' || $(this).attr("id") == 'line_click_num_2'){
var field_name = 'line_see_num';
}
$.ajax({
type: "POST",
url: "/"+ url +"/click_num",
'data' : {
'field_name' : field_name,
'id' : id,
},
success: function(info) {
/*if(field_name == 'line_see_num'){
if($('#browser').val() == 'line'){
location.href = 'http://line.naver.jp/R/msg/text/?'.concat(encodeURIComponent(location.href));
}
}else if(field_name == 'fb_see_num'){
if($('#browser').val() == 'line'){
location.href = 'http://www.facebook.com/share.php?u='.concat(encodeURIComponent(location.href));
}
}*/
window.location.reload();
}
});
});