resolve conflict

ajax_post
Yang Liuxin 3 years ago
parent 731c5a7c73
commit 6b69dc669a

@ -13,7 +13,6 @@
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": true

@ -4,21 +4,16 @@
* Reference: http://www.internetke.com/effects/menu/2015/1119/1833.html
*/
(function($, window, document, undefined) {
//插件初始化
function init(target, options) {
var settings = $.extend({}, $.fn.socialShare.defaults, options);
//初始化各个组件
var $msb_main = "<a class='msb_main'><img title='分享' src='images/share_core_square.jpg'></a>";
var $social_group = "<div class='social_group'>"
+ "<a target='_blank' class='msb_network_button weixin'>weixin</a>"
+ "<a target='_blank' class='msb_network_button sina'>sina</a>"
+ "<a target='_blank' class='msb_network_button tQQ'>tQQ</a>"
+ "<a target='_blank' class='msb_network_button qZone'>qZone</a>"
+ "<a target='_blank' class='msb_network_button douban'>douban</a>"
+ "</div>";
$(target).append($msb_main);
$(target).append($social_group);
var $msbMain = "<a class='msb_main'><img title='分享' src='../Image/share_core_square.jpg'></a>";
var $socialGroup = "<div class='$socialGroup'>" + "<a target='_blank' class='msb_network_button weixin'>weixin</a>" + "<a target='_blank' class='msb_network_button sina'>sina</a>" + "<a target='_blank' class='msb_network_button tQQ'>tQQ</a>" + "<a target='_blank' class='msb_network_button qZone'>qZone</a>" + "<a target='_blank' class='msb_network_button douban'>douban</a>" + "</div>";
$(target).append($msbMain);
$(target).append($socialGroup);
$(target).addClass("socialShare");
@ -44,7 +39,7 @@
});
$(document).on("click",".msb_main",function(){
if ($(this).hasClass("disabled")) return;
var e = 500;//动画时间
e = 500;//动画时间
var t = 250;//延迟时间
var r = $(this).parent().find(".msb_network_button").length; //分享组件的个数
var i = 60;
@ -60,7 +55,7 @@
if (!$(this).hasClass("active")) {
$(this).addClass("disabled").delay(s).queue(function(e) {
$(this).removeClass("disabled").addClass("active");
e()
e();
});
$(this).parent().find(".msb_network_button").each(function() {
var n = p + (p + i * o) * Math.cos(v); //结束位置
@ -73,21 +68,21 @@
left: n + "px",
top: r + "px"
}, e);
o++
})
o++;
});
} else {
o = r;
$(this).addClass("disabled").delay(s).queue(function(e) {
$(this).removeClass("disabled").removeClass("active");
e()
e();
});
$(this).parent().find(".msb_network_button").each(function() {
$(this).stop().delay(t * o).animate({
left: p,
top: d
}, e);
o--
})
o--;
});
}
});
@ -96,10 +91,10 @@
}
function replaceAPI (api,options) {
api = api.replace('{url}', options.url);
api = api.replace('{title}', options.title);
api = api.replace('{content}', options.content);
api = api.replace('{pic}', options.pic);
api = api.replace("{url}", options.url);
api = api.replace("{title}", options.title);
api = api.replace("{content}", options.content);
api = api.replace("{pic}", options.pic);
return api;
}
@ -131,22 +126,22 @@
}
$.fn.socialShare = function(options, param) {
if(typeof options == 'string'){
if(typeof options === "string"){
var method = $.fn.socialShare.methods[options];
if(method)
return method(this,param);
}else
init(this,options);
}
};
//插件默认参数
$.fn.socialShare.defaults = {
url: window.location.href,
title: document.title,
content: '',
pic: ''
}
content: "",
pic: ""
};
//插件方法
$.fn.socialShare.methods = {
@ -159,12 +154,12 @@
tQQ:function(jq,options){
return jq.each(function(){
tQQ(this,options);
})
});
},
qZone:function(jq,options){
return jq.each(function(){
qZone(this,options);
})
});
},
sinaWeibo:function(jq,options) {
return jq.each(function(){
@ -181,15 +176,14 @@
weixinShare(this,options);
});
}
}
};
//分享地址
var qzone = 'http://www.internetke.com/';
var sina = 'http://www.internetke.com/';
var tqq = 'http://www.internetke.com/';
var douban = 'http://www.internetke.com/';
var weixin = 'http://www.internetke.com/';
var qzone = 'http://baidu.com';
var sina = 'http://baidu.com/';
var tqq = 'http://baidu.com/';
var douban = 'http://baidu.com/';
var weixin = 'http://baidu.com/';
})(jQuery, window, document);

@ -1,35 +1,123 @@
/**
Reference: http://www.internetke.com/effects/menu/2015/1119/1833.html
*/
@charset "utf-8";
body, ul, dl, dd, dt, ol, li, p, h1, h2, h3, h4, h5, h6, textarea, form, select, fieldset, table, td, div, input {margin:0;padding:0;-webkit-text-size-adjust: none}
h1, h2, h3, h4, h5, h6{font-size:12px;font-weight:normal}
body>div{margin:0 auto}
div {text-align:left}
a img {border:0}
body { color: #333; text-align: center; font: 12px "微软雅黑"; }
ul, ol, li {list-style-type:none;vertical-align:0}
a {outline-style:none;color:#535353;text-decoration:none}
a:hover { color: #D40000; text-decoration: none}
.clear{height:0; overflow:hidden; clear:both}
.button {display: inline-block;zoom: 1; *display: inline;vertical-align: baseline;margin: 0 2px;outline: none;cursor: pointer;text-align: center;text-decoration: none;font: 14px/100% Arial, Helvetica, sans-serif;padding:0.25em 0.6em 0.3em;text-shadow: 0 1px 1px rgba(0,0,0,.3);-webkit-border-radius: .5em; -moz-border-radius: .5em;border-radius: .5em;-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.red {color: #faddde;border: solid 1px #980c10;background: #d81b21;background: -webkit-gradient(linear, left top, left bottom, from(#ed1c24), to(#A51715));background: -moz-linear-gradient(top, #ed1c24, #A51715);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed1c24', endColorstr='#aa1317');
}
.red:hover { background: #b61318; background: -webkit-gradient(linear, left top, left bottom, from(#c9151b), to(#a11115)); background: -moz-linear-gradient(top, #c9151b, #a11115); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c9151b', endColorstr='#a11115'); color:#fff;}
.red:active {color: #de898c;background: -webkit-gradient(linear, left top, left bottom, from(#aa1317), to(#ed1c24));background: -moz-linear-gradient(top, #aa1317, #ed1c24);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#aa1317', endColorstr='#ed1c24');}
.cor_bs,.cor_bs:hover{color:#ffffff;}
.keBody{background:url(Image/bodyBg.jpg) repeat #333;}
.keTitle{height:100px; line-height:100px; font-size:30px; font-family:'微软雅黑'; color:#FFF; text-align:center; background:url(Image/bodyBg3.jpg) repeat-x bottom left; font-weight:normal}
.kePublic{background:#FFF; padding:50px;}
.keBottom{color:#FFF; padding-top:25px; line-height:28px; text-align:center; font-family:'微软雅黑'; background:url(Image/bodyBg2.jpg) repeat-x top left; padding-bottom:25px}
.keTxtP{font-size:16px; color:#ffffff;}
.keUrl{color:#FFF; font-size:30px;}
.keUrl:hover{ text-decoration: underline; color: #FFF; }
.mKeBanner,.mKeBanner div{text-align:center;}
.socialShare { display: block; width: 54px; height: 54px; position: relative; z-index: 1; margin: 0px auto; left: -150px; }
.socialShare .msb_main {
body, ul, dl, dd, dt, ol, li, p, h1, h2, h3, h4, h5, h6, textarea, form, select, fieldset, table, td, div, input {
margin: 0;
padding: 0;
-webkit-text-size-adjust: none
}
h1, h2, h3, h4, h5, h6 {
font-size: 12px;
font-weight: normal
}
body > div {
margin: 0 auto
}
div {
text-align: left
}
a img {
border: 0
}
body {
color: #333;
text-align: center;
font: 12px "微软雅黑";
}
ul, ol, li {
list-style-type: none;
vertical-align: 0
}
a {
outline-style: none;
color: #535353;
text-decoration: none
}
a:hover {
color: #D40000;
text-decoration: none
}
.clear {
height: 0;
overflow: hidden;
clear: both
}
.button {
display: inline-block;
zoom: 1;
*display: inline;
vertical-align: baseline;
margin: 0 2px;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
padding: 0.25em 0.6em 0.3em;
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
border-radius: .5em;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.red {
color: #faddde;
border: solid 1px #980c10;
background: #d81b21;
background: -webkit-gradient(linear, left top, left bottom, from(#ed1c24), to(#A51715));
background: -moz-linear-gradient(top, #ed1c24, #A51715);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed1c24', endColorstr='#aa1317');
}
.red:hover {
background: #b61318;
background: -webkit-gradient(linear, left top, left bottom, from(#c9151b), to(#a11115));
background: -moz-linear-gradient(top, #c9151b, #a11115);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c9151b', endColorstr='#a11115');
color: #fff;
}
.red:active {
color: #de898c;
background: -webkit-gradient(linear, left top, left bottom, from(#aa1317), to(#ed1c24));
background: -moz-linear-gradient(top, #aa1317, #ed1c24);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#aa1317', endColorstr='#ed1c24');
}
.cor_bs, .cor_bs:hover {
color: #ffffff;
}
#socialShare {
display: block;
width: 46px;
height: 46px;
width: 66px;
height: 66px;
position: relative;
z-index: 1;
margin: 0px auto;
left: -150px;
}
#socialShare .msb_main {
display: block;
width: 66px;
height: 66px;
position: absolute;
top: 0;
left: 0;
@ -40,20 +128,23 @@ a:hover { color: #D40000; text-decoration: none}
box-shadow: 0 0 5px #DDD;
border-radius: 36px;
}
.socialShare .msb_main:hover {
#socialShare .msb_main:hover {
box-shadow: 0 0 5px #BBB;
}
.socialShare .msb_main img {
width: 46px;
height: 46px;
#socialShare .msb_main img {
width: 66px;
height: 66px;
cursor: pointer;
border-radius: 23px;
border: none;
float: left
}
.socialShare .msb_network_button {
width: 31px;
height: 31px;
#socialShare .msb_network_button {
width: 46px;
height: 46px;
position: absolute;
top: 9px;
left: 92px;
@ -62,22 +153,31 @@ a:hover { color: #D40000; text-decoration: none}
text-indent: -9999px;
display: none;
background: no-repeat;
border: 6px solid #f5f5f5;
border-radius: 50%;
border: 6px solid #f5f5f5;
border-radius: 50%;
}
.socialShare .msb_network_button.sina {
#socialShare .msb_network_button.sina {
background: url(Image/social.png) no-repeat -130px -87px;
}
.socialShare .msb_network_button.tQQ {
#socialShare .msb_network_button.tQQ {
background: url(Image/social.png) no-repeat -185px -20px;
}
.socialShare .msb_network_button.qZone {
#socialShare .msb_network_button.qZone {
background: url(Image/social.png) no-repeat -73px -20px;
}
.socialShare .msb_network_button.douban {
#socialShare .msb_network_button.douban {
background: url(Image/social.png) no-repeat -130px -151px;
}
.socialShare .msb_network_button.weixin {
#socialShare .msb_network_button.weixin {
background: url(Image/social.png) no-repeat -73px -87px;
}
.socialShare .msb_network_button:hover{transition: -moz-transform 2s ease-out 0s;border: 6px solid #eee;}
#socialShare .msb_network_button:hover {
transition: -moz-transform 2s ease-out 0s;
border: 6px solid #eee;
}

@ -39,6 +39,21 @@
var submit = document.getElementById('submit')
submit.className = 'btn btn-primary';
submit.style = "margin-left: 40px";
$(function () {
$("#socialShare").socialShare({
content: '',
url: '',
titile: ''
});
});
$("#shareQQ").on("click", function () {
$(this).socialShare("tQQ");
})
</script>
{% endblock %}
@ -52,29 +67,27 @@
<div class="post-content col-sm-offset-1 col-sm-10">
{# 标题#}
<h1 class="post-title text-center" style="margin: 30px">
<h1 class="post-title text-center" style="margin: 30px; font-size: 35px">
<a href="{{ url_for('.post', id=post.id) }}">
{{ post.title }}
</a>
{# <div id="socialShare"></div>#}
{# <script>#}
{# $(function () {#}
{##}
{# $("#socialShare").socialShare({#}
{# content: '',#}
{# url: '',#}
{# titile: ''#}
{# });#}
{##}
{# });#}
{##}
{# $("#shareQQ").on("click", function () {#}
{# $(this).socialShare("tQQ");#}
{# })#}
{# </script>#}
</h1>
<div id="socialShare"></div>
{# <script>#}
{# $(function () {#}
{##}
{# $("#socialShare").socialShare({#}
{# content: '',#}
{# url: '',#}
{# titile: ''#}
{# });#}
{##}
{# });#}
{##}
{# $("#shareQQ").on("click", function () {#}
{# $(this).socialShare("tQQ");#}
{# })#}
{# </script>#}
{# 正文#}
<div class="content" id="fancy-content" style="padding-bottom:20px;
border-bottom: 1px solid #ddd;margin: 30px;">

Loading…
Cancel
Save