js浮動客服代碼演示地址大全,js浮動客服代碼演示地址大全下載

本文目錄一覽:

這是一段在線客服JS代碼它是右邊浮動的如何改讓它左浮動?

代碼中沒有出現left 及 width,可能 在線客服 的css style決定了它的豎直位置,請看看 divQQbox

等一些div的樣式。

求一個能用的右側浮動JS代碼

請將代碼放置在head/head之間即可

script language=”javascript”

suspendcode=”DIV id=lovexin style=’Z-INDEX: 10; LEFT: 850px; POSITION: absolute; TOP: 140px; width: 88px; height: 203px;’a href=”img src=’../20080128/er_p.jpg’ width=’150′ height=’200′ border=’0’/a/DIV”

document.write(suspendcode);

lastScrollY=0;

function heartBeat(){

diffY=document.body.scrollTop;

percent=.1*(diffY-lastScrollY);

if(percent0)percent=Math.ceil(percent);

else percent=Math.floor(percent);

document.all.lovexin.style.pixelTop+=percent;

lastScrollY=lastScrollY+percent;

}

window.setInterval(“heartBeat()”,1);

/script

代碼說明:

1、加到左側的時候,把left屬性改為10就好;

2、TOP是控制這個浮動廣告離上邊的距離,可以根據自己的實際情況進行調整;

3、這裡href=’和這裡img src=’../20080128/er_p.jpg’ 換成你想要的浮動廣告的圖片。其中這句src=../20080128/er_p.jpg’ width=’150′ height=’200’border=’0′ 中WIDTH=『150』 height=’200’是你浮動廣告圖片的寬和高。

浮動窗口的代碼 (html/js)

第一種方法:

Html代碼

html

head

title浮動窗口/title

link type=”text/css” rel=”stylesheet” href=”css/overflow.css” /

script type=”text/javascript” src=”js/jquery.js”/script

script type=”text/javascript” src=”js/overflow.js”/script

script type=”text/javascript”

$(document).ready(function(){

var b = $(“#b”);

var overFlow = $(“#over”);

b.click(function(){

overFlow.fadeIn();

$(“#mask”).css(“background”,”#111″);

$(“#mask”).css(“opacity”,”0.8″);

})

$(“#close”).click(function(){

overFlow.fadeOut();

$(“#mask”).css(“background”,”#fff”);

$(“#mask”).css(“opacity”,”1″);

});

drag($(“#over”),$(“#title”));

}) ;

/script

/head

body

div id=”over”

div id=”title”span id=”t”這只是一個演示標題/spanspan id=”close”[ x ]/span/div

div id=”content”

When a container object, such as a div, has mouse capture, events originating on objects within that container are fired by the div, unless the bContainerCapture parameter of the setCapture method is set to false. Passing the value false causes the container to no longer capture all document events. Instead, objects within that container still fire events, and those events also bubble as expected.br/

—This is edited by Alp.

/div

/div

div id=”mask” a id=”b” href=”#”click/a/div

/body

/html

Js代碼

function drag(overFlow,title){

title.onmousedown = function(evt){

var doc = document;

var evt = evt || window.event;

var x = evt.offsetX?evt.offsetX:evt.layerX;

var y = evt.offsetY?evt.offsetY:evt.layerY;

if(overFlow.setCapture){

overFlow.setCapture();

}else if(window.captureEvents){

window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);

}

doc.onmousemove = function(evt){

evt = evt || window.event;

var xPosition = evt.pageX || evt.clientX;

var yPosition = evt.pageY || evt.clientY;

var newX = xPosition – x;

var newY = yPosition – y;

overFlow.style.left = newX;

overFlow.style.top = newY;

};

doc.onmouseup = function(){

if(overFlow.releaseCapture){

overFlow.releaseCapture();

}else if(window.captureEvents){

window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);

}

doc.onmousemove=null;

doc.onmouseup=null;

};

};

}

css代碼

#over{

position: absolute;

left: 300px;

top: 200px;

border: 1px solid black;

display: none;

background: #cccccc;

cursor: default;

width: 300px;

z-index: 10;

opacity: 1;

}

#title{

border: 1px solid #1840C4;

background: #95B4DC;

padding: 2px;

font-size:12px;

cursor: default;

}

#close{

cursor: pointer;

margin-right: 1px;

overflow: hidden;

}

#content{

border: 1px solid #C2D560;

background: #EFF4D7;

}

#t{

margin-right:145px;

}

#mask{

z-index: 1;

background: #fff;

width: 1024px;

height: 800px;

}

#b{

position: absolute;

left: 200px;

top: 100px;

}

body{

padding: 0px;

margin: 0px;

}

#over{

background: transparent;

}

第二種方法:

消息框遮罩層:iframe id=”show_upload_iframe” frameborder=0 scrolling=”no” style=”display:none; position:absolute;”/iframediv id=”show_upload”nothing…/div’

頁面載入loading中:div id=”body_loading” onClick=”loaded();”img src=”__PUBLIC__/images/body_load.gif”/div

關閉浮動窗口:a href=”javascript:hideupload()”關閉窗口建議用小圖片/a

打開浮動窗口:a href=”javascript:showupload(‘admin.php’)”打開浮動/a

// 消息框loading

function loading(){

var o = $(‘#body_loading’);

o.css(“left”,(($(document).width())/2-(parseInt(o.width())/2))+”px”);

o.css(“top”,(($(document).height()+$(document).scrollTop())/2-(parseInt(o.height())/2))+”px”);

o.fadeIn(“fast”);

}

// 消息框消失

function loaded(){

var o = $(‘#body_loading’);

o.fadeOut(“fast”);

}

// 隱藏浮動窗口

function hideupload(){

$(‘#show_upload’).hide();

$(‘#show_upload_iframe’).hide();

}

// 彈出浮動窗口

function showupload(ajaxurl){

loading();

var o=$(‘#show_upload’);

var f=$(‘#show_upload_iframe’);

var top = 200;

$.ajax({

url: ajaxurl,

//cache: false,

success: function(res){

loaded();

o.html(res);

o.css(“left”,(($(document).width())/2-(parseInt(o.width())/2))+”px”);

if($(document).scrollTop()200){

top = ($(document).height()+$(document).scrollTop())/2-(parseInt(o.height())/2);

}

o.css(“top”,top+”px”);

f.css({‘width’:o.width(),’height’:o.height(),’left’:o.css(‘left’),’top’:o.css(‘top’)});

f.show();

o.show();

}

});

}

jQuery實現的網頁左側在線客服效果代碼

本文實例講述了jQuery實現的網頁左側在線客服效果代碼。分享給大家供大家參考,具體如下:

這是又一個網頁上的在線客服代碼,不錯,可以用一下哦。與其它客服不一樣的地方呢?無非是在網頁左側滑出,可對客服類型分組,又多了一個功能,哈哈。

運行效果截圖如下:

在線演示地址如下:

具體代碼如下:

!DOCTYPE

html

PUBLIC

“-//W3C//DTD

XHTML

1.0

Transitional//EN”

“”

html

xmlns=””

head

title網頁左側浮動jquery在線QQ客服代碼/title

style

*{margin:0px;padding:0px;outline:none;list-style-type:none;border:none;}

/*

QQbox

*/

.QQbox{z-index:1000;width:410px;left:-276px;top:0;margin:149px

0;position:fixed;}

*html,

*html

body{background-image:url(about:blank);background-attachment:fixed;}

*html

.QQbox{position:absolute;

top:expression(eval(document.documentElement.scrollTop));}

.QQbox

.press{left:0;border:none;cursor:pointer;width:32px;height:96px;position:absolute;padding-top:140px;}

.QQbox

.Qlist{float:left;width:410px;background:url(images/bj01.png)

no-repeat;background-position:1px

0px;height:436px;display:block;overflow:hidden;zoom:1;}

.QQbox

.Qlist

.infobox{text-align:center;background-repeat:no-repeat;padding:5px;line-height:14px;color:#CCCCCC;font-weight:700;}

.QQbox

.Qlist

.con{margin-top:266px;margin-left:50px;color:#32567e;font-size:14px;}

.QQbox

.Qlist

.con

ul

li{height:31px;list-style:none;margin-left:35px;}

.QQbox

.Qlist

.con

ul

li

a{font-size:13px;margin-left:18px;text-decoration:none;}

.OnlineLeft{float:left;display:inline;width:262px;height:439px;overflow:hidden;zoom:1;}

.OnlineBtn{float:right;display:inline;width:127px;height:36px;background:url(images/bj02.png)

no-repeat;margin-top:-45px;margin-left:220px;}

/style

script

type=”text/javascript”

src=”jquery-1.6.2.min.js”/script

/head

body

div

id=”divQQbox”

class=”QQbox”

div

id=”divOnline”

class=”Qlist”

div

class=”OnlineLeft”

div

class=”con”

ul

li售前諮詢a

target=”_blank”

href=”tencent://message/?uin=12345678Site=;Menu=yes”img

border=”0″

src=””/a/li

li網站建設a

target=”_blank”

href=”tencent://message/?uin=12345678Site=;Menu=yes”img

border=”0″

src=””/a/li

li網站優化a

target=”_blank”

href=”tencent://message/?uin=12345678Site=;Menu=yes”img

border=”0″

src=””/a/li

li整合營銷a

target=”_blank”

href=”tencent://message/?uin=12345678Site=;Menu=yes”img

border=”0″

src=””/a/li

li售後服務a

target=”_blank”

href=”tencent://message/?uin=12345678Site=;Menu=yes”img

border=”0″

src=””/a/li

/ul

/div

/div

div

class=”OnlineBtn”

/div

/div

/div

script

type=”text/javascript”

$(function(){

//建站熱線展開效果

$(“#divQQbox”).hover(

function(){

$(this).stop(true,false);

$(this).animate({left:0},300);

},

function(){

$(this).animate({left:-276},149);

}

)

});

/script

/body

/html

希望本文所述對大家jQuery程序設計有所幫助。

JS網頁中的浮動窗口代碼?

script

function scrolls(){

var advobj=document.getElementById(“adv”);

advobj.style.top=100+document.documentElement.scrollTop+”px”;

}

window.onscroll=scrolls;

function winclose(){

var advobj=document.getElementById(“adv”);

advobj.style.display=”none”;

}

/script

body

!–隨滾動條移動的浮動窗口############################–

div id=”adv” style=””

img src=”圖片路徑”/

div id=”close” onclick=”winclose()”關閉/div

/div

div id=”header”iframe src=”header.html” height=”155px” width=”960px” frameborder=”0″scrolling=”no”/iframe/div

/body

js在線客服代碼

將index里的代碼對應你要放客服代碼的頁面,複製粘貼就可以了,注意 js放到head之前就行了,圖片放入相對路程徑的圖片文件夾下。

原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/241628.html

(0)
打賞 微信掃一掃 微信掃一掃 支付寶掃一掃 支付寶掃一掃
小藍的頭像小藍
上一篇 2024-12-12 12:42
下一篇 2024-12-12 12:42

相關推薦

  • Python周杰倫代碼用法介紹

    本文將從多個方面對Python周杰倫代碼進行詳細的闡述。 一、代碼介紹 from urllib.request import urlopen from bs4 import Bea…

    編程 2025-04-29
  • cmd看地址

    本文將從多個方面詳細闡述cmd看地址,包括如何查看本機IP地址、如何查看路由器IP、如何查看DNS伺服器IP等等。 一、查看本機IP地址 要查看本機IP地址,首先需要打開cmd窗口…

    編程 2025-04-29
  • Python字元串寬度不限制怎麼打代碼

    本文將為大家詳細介紹Python字元串寬度不限制時如何打代碼的幾個方面。 一、保持代碼風格的統一 在Python字元串寬度不限制的情況下,我們可以寫出很長很長的一行代碼。但是,為了…

    編程 2025-04-29
  • Python基礎代碼用法介紹

    本文將從多個方面對Python基礎代碼進行解析和詳細闡述,力求讓讀者深刻理解Python基礎代碼。通過本文的學習,相信大家對Python的學習和應用會更加輕鬆和高效。 一、變數和數…

    編程 2025-04-29
  • Python滿天星代碼:讓編程變得更加簡單

    本文將從多個方面詳細闡述Python滿天星代碼,為大家介紹它的優點以及如何在編程中使用。無論是剛剛接觸編程還是資深程序員,都能從中獲得一定的收穫。 一、簡介 Python滿天星代碼…

    編程 2025-04-29
  • 倉庫管理系統代碼設計Python

    這篇文章將詳細探討如何設計一個基於Python的倉庫管理系統。 一、基本需求 在著手設計之前,我們首先需要確定倉庫管理系統的基本需求。 我們可以將需求分為以下幾個方面: 1、庫存管…

    編程 2025-04-29
  • 寫代碼新手教程

    本文將從語言選擇、學習方法、編碼規範以及常見問題解答等多個方面,為編程新手提供實用、簡明的教程。 一、語言選擇 作為編程新手,選擇一門編程語言是很關鍵的一步。以下是幾個有代表性的編…

    編程 2025-04-29
  • Python實現簡易心形代碼

    在這個文章中,我們將會介紹如何用Python語言編寫一個非常簡單的代碼來生成一個心形圖案。我們將會從安裝Python開始介紹,逐步深入了解如何實現這一任務。 一、安裝Python …

    編程 2025-04-29
  • 尚矽谷官網地址用法介紹

    尚矽谷是國內一家領先的技術培訓機構,提供了眾多IT職業的培訓,包括Java、Python、大數據、前端、人工智慧等方向。其官網地址為http://www.atguigu.com/。…

    編程 2025-04-29
  • 怎麼寫不影響Python運行的長段代碼

    在Python編程的過程中,我們不可避免地需要編寫一些長段代碼,包括函數、類、複雜的控制語句等等。在編寫這些代碼時,我們需要考慮代碼可讀性、易用性以及對Python運行性能的影響。…

    編程 2025-04-29

發表回復

登錄後才能評論