Skip to content

Instantly share code, notes, and snippets.

View Joseph7451797's full-sized avatar

Joseph Chang Joseph7451797

View GitHub Profile
<b:if cond='data:blog.isMobile'>
<b:else/>
<div id="popup">
<span class="cross">X</span>
<p style="padding-left: 5px;line-height: 200%">簡單文字說明,依自己需求寫入任意文字</p>
<span class="closebutton">取消</span>
<span class="goquestion" ><a href="javascript: void(window.open('問卷網址'.concat(encodeURIComponent(document.title)) .concat(' ') .concat(encodeURIComponent(location.href)),'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=650,width=700'));">填問卷去</a></span>
</div>
</b:if>
<style type='text/css'>
<!--
#popup{ /* 浮動視窗的css語法 */
font-size: 16px;
display: none;
background-color: #fffacd;
width: 220px;
padding: 15px 15px;
left: 45px;
bottom: 30px;
<script type='text/javascript'> // 網頁底端浮動視窗的js語法
$(function(){
$(window).scroll(function() {
if($(document).scrollTop() + $(window).height() >= $(document.body).height()) {
$("#popup").fadeIn('slow')
}
else if( $(document).scrollTop() < 400) {
$("#popup").fadeOut('slow')
}
});
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js"></script>
<!-- 行動版浮動按鈕的html語法 -->
<b:if cond='data:blog.isMobile'>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<a href='自己的網站首頁網址'>
<div class='footergohome'>
回到首頁
</div>
</a>
<a href='網站的最新消息頁面網址'>
<div class='footergoaboutme'>
<style type='text/css'>
.footergohome{ /* 回首頁浮動按鈕的css語法 */
font-size:28px;
text-align: center;
z-index: 20;
display: none;
position: fixed;
padding: 15px 15px 15px 0px;
background: #eee;
<script type='text/javascript'> // 行動版浮動按鈕的js語法
$(document).ready(function(){
var previous = 0,
textWindowNow = 0;
$(window).scroll(function(){
previous = $(this).scrollTop();
if(textWindowNow - previous >= 10){ //上滚
$('.footergohome,.footergoaboutme').show("blind", 200 )
}
else if (previous - textWindowNow >= 5){ //下滚
div {
display: block;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="img-wrapper"></div>
<script id="jsbin-source-javascript" type="text/javascript">
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="ccc">clicktoserial</div>
<div id="ddd">clicktorandom</div>