jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jquery

WBOY
풀어 주다: 2016-05-16 15:05:12
원래의
1415명이 탐색했습니다.

이 문서의 예에서는 프롬프트 레이어 효과 코드를 따르는 마우스의 jQuery 구현을 설명합니다. 참고하실 수 있도록 모든 사람과 공유하세요. 자세한 내용은 다음과 같습니다.

런닝 효과 스크린샷은 다음과 같습니다.

jquery의 jquery.cluetip.js와 결합하여 팁 프롬프트 레이어를 사용해야 하는 웹 사이트가 많이 있으며, 로컬 문자 또는 ajax를 비동기적으로 호출하여 프롬프트 레이어를 표시할 수 있습니다. 위의 구매등급 내역에서 보이듯이. (장점: 페이지 로드 시 너비를 정의해야 하며, 높이는 자동이며, 삼각형 지정 아이콘은 표시 레이어의 크기와 위치에 따라 위치를 호출하여 눈길을 사로잡고 직관적인 효과를 얻을 수 있습니다)

jquery.cluetip.css

/* global */
#cluetip-jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jquery img {
 border: 0;
}
#cluetip-title {
 overflow: hidden;
}
#cluetip-title #cluetip-jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jquery {
 float: right;
 position: relative;
}
#cluetip-waitimage {
 width: 43px;
 height: 11px;
 position: absolute;
 background-image: url(../img_new/cluetipwait.gif);
}
.cluetip-arrows {
 display: none;
 position: absolute;
 top: 0;
 left: -11px;
 height: 22px;
 width: 11px;
 background-repeat: no-repeat;
 background-position: 0 0;
}
#cluetip-extra {
 display: none;
}
/***************************************
  =cluetipClass: 'default' 
-------------------------------------- */
.cluetip-default {
 background-color: #d9d9c2;
}
.cluetip-default #cluetip-outer {
 position: relative;
 margin: 0;
 background-color: #d9d9c2;
}
.cluetip-default h3#cluetip-title {
 margin: 0 0 5px;
 padding: 8px 10px 4px;
 font-size: 14px;
 font-weight: normal;
 background-color: #87876a;
 color: #fff;
}
.cluetip-default #cluetip-title a {
 color: #d9d9c2;
 font-size: 0.95em;
} 
.cluetip-default #cluetip-inner {
 padding: 10px;
}
.cluetip-default div#cluetip-jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jquery { 
 text-align: right;
 margin: 0 5px 5px;
 color: #900;
}
/* default arrows */
.clue-right-default .cluetip-arrows {
 background-image: url(../img_new/cluetipdarrowleft.gif);
}
.clue-left-default .cluetip-arrows {
 background-image: url(../img_new/cluetipdarrowright.gif);
 left: 100%;
 margin-right: -11px;
}
.clue-top-default .cluetip-arrows {
 background-image: url(../img_new/cluetipdarrowdown.gif);
 top: 100%;
 left: 50%;
 margin-left: -11px;
 height: 11px;
 width: 22px; 
} 
.clue-bottom-default .cluetip-arrows {
 background-image: url(../img_new/cluetipdarrowup.gif);
 top: -11px;
 left: 50%;
 margin-left: -11px;
 height: 11px;
 width: 22px;
}
/***************************************
  =cluetipClass: 'jtip'
-------------------------------------- */
.cluetip-jtip {
 background-color: transparent;
  display:none;
}
.cluetip-jtip #cluetip-outer {
 border: 1px solid #559EF8;
 position: relative;
 background-color: #fff;
}
.cluetip-jtip h3#cluetip-title {
 margin: 0 0 5px;
 padding: 2px 5px;
 font-size: 12px;
 font-weight: normal;
 background-color: #559EF8;
 color: #fff; 
}
.cluetip-jtip #cluetip-inner {
 padding: 0 5px 5px;
 display: inline-block;
}
.cluetip-jtip div#cluetip-jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jquery { 
 text-align: right;
 margin: 0 5px 5px;
 color: #900; 
 display:none;
}
/* jtip arrows */
.clue-right-jtip .cluetip-arrows {
 background-image: url(../img_new/cluetiparrowleft.gif);
}
.clue-left-jtip .cluetip-arrows {
 background-image: url(../img_new/cluetiparrowright.gif);
 left: 100%;
 margin-right: -11px;
}
.clue-top-jtip .cluetip-arrows {
 background-image: url(../img_new/cluetiparrowdown.gif);
 top: 100%;
 left: 50%;
 margin-left: -11px;
 height: 11px;
 width: 22px; 
} 
.clue-bottom-jtip .cluetip-arrows {
 background-image: url(../img_new/cluetiparrowup.gif);
 top: -11px;
 left: 50%;
 margin-left: -11px;
 height: 11px;
 width: 22px;
}
/***************************************
  =cluetipClass: 'rounded'
-------------------------------------- */
.cluetip-rounded {
 background: transparent url(../img_new/cluetipbl.gif) no-repeat 0 100%;
 margin-top: 10px;
 margin-left: 12px;
}
.cluetip-rounded #cluetip-outer {
 background: transparent url(../img_new/cluetiptl.gif) no-repeat 0 0;
 margin-top: -12px;
}
.cluetip-rounded #cluetip-title {
 background-color: transparent;
 padding: 12px 12px 0;
 margin: 0 -12px 0 0;
 position: relative;
}
.cluetip-rounded #cluetip-extra {
 position: absolute;
 display: block;
 background: transparent url(../img_new/cluetiptr.gif) no-repeat 100% 0;
 top: 0;
 right: 0;
 width: 12px;
 height: 30px;
 margin: -12px -12px 0 0;
}
.cluetip-rounded #cluetip-inner {
 background: url(../img_new/cluetipbr.gif) no-repeat 100% 100%;
 padding: 5px 12px 12px;
 margin: -18px -12px 0 0;
 position: relative;
}
.cluetip-rounded div#cluetip-jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jquery { 
 text-align: right;
 margin: 0 5px 5px;
 color: #009;
 background: transparent;
}
.cluetip-rounded div#cluetip-jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jquery a {
 color: #777;
}
/* rounded arrows */
.clue-right-rounded .cluetip-arrows {
 background-image: url(../img_new/cluetiprarrowleft.gif);
}
.clue-left-rounded .cluetip-arrows {
 background-image: url(../img_new/cluetiprarrowright.gif);
 left: 100%;
 margin-left: 12px;
}
.clue-top-rounded .cluetip-arrows {
 background-image: url(../img_new/cluetiprarrowdown.gif);
 top: 100%;
 left: 50%;
 margin-left: -11px;
 height: 11px;
 width: 22px; 
} 
.clue-bottom-rounded .cluetip-arrows {
 background-image: url(../img_new/cluetiprarrowup.gif);
 top: -23px;
 left: 50%;
 margin-left: -11px;
 height: 11px;
 width: 22px;
}
/* stupid IE6 HasLayout hack */
.cluetip-rounded #cluetip-title,
.cluetip-rounded #cluetip-inner {
 zoom: 1;
}
.float-left {
 float: left;
 margin-right: .5em;
 display: inline;
 position: relative;
}
.float-right {
 float: right;
 margin-left: .5em;
 display: inline;
 position: relative;
}

로그인 후 복사

jquery-1.3.2.min.js - 공식 홈페이지에서 다운로드 가능하며 여기서는 설명하지 않겠습니다. (필수)
jquerycluetipLoad.js -- 프롬프트 레이어의 기본 매개변수 및 속성을 정의합니다.

/* Jquery 鼠标跟随提示层。
 * 创建人:fooo
 * 创建日期:09-09-23
 * 修改人:
 * 修改日期:
 * 本地字符提示示例:<span title="标题|<%=Str()%>"><a href="#" >我们的</a></span>
 * Ajax异步调用文件且提示示例:<ol><li><a class="jt" href="#" title="评分项目明细" rel="HandlerAjax.ashx&#63;Name=<%=Security.EncryptQueryString("我们的我我我人大")%>" >clueTip - Ajax异步提示1</a> </li></ol>
 *
 * 改变提示层宽度大小,只需在调用页加入: $.fn.cluetip.defaults.width = '100'; -根据大小调整。
 */
 // $.fn.cluetip.defaults.tracking = true;
 // $.fn.cluetip.defaults.width = 'auto';
$(document).ready(function() 
{
 //default theme
 $('a.title').cluetip({splitTitle: '|'});
 $('a.basic').cluetip();
 $('a.custom-width').cluetip({width: '200px', showTitle: false});
 $('h4').cluetip({attribute: 'id', hoverClass: 'highlight'});
 $('#sticky').cluetip({sticky: true, jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jqueryPosition: 'title', arrows: true });
 $('#examples a:eq(5)').cluetip({
  hoverClass: 'highlight',
  sticky: true,
  jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jqueryPosition: 'bottom',
  jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jqueryText: '<img src="../img_new/cluetipcross.png" alt="jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jquery"    style="max-width:90%"  style="max-width:90%" />',
  truncate: 60
 });
 $('a.load-local').cluetip({local:true, hideLocal: true, sticky: true, arrows: true, cursor: 'pointer'});
 $('#clickme').cluetip({activation: 'click', sticky: true, width: 250});
 $('ol:first a:last').cluetip({tracking: true});
 //jTip theme
 $('a.jt:eq(0)').cluetip({
  cluetipClass: 'jtip', 
  arrows: true, 
  dropShadow: false,
  sticky: true,
  mouseOutClose: true,
  jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jqueryPosition: 'title',
  jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jqueryText: '<img src="../img_new/cluetipcross.png" alt="jQuery는 프롬프트 레이어 효과 코드에 따라 마우스를 구현합니다(텍스트, Div, Table, Html 등을 표시할 수 있음)_jquery" />'
 });
 $('a.jt:eq(1)').cluetip({cluetipClass: 'jtip', arrows: true, dropShadow: false, hoverIntent: false});
 $('span[title]').css({borderBottom: '0px solid #900'}).cluetip({splitTitle: '|', arrows: true, dropShadow: false, cluetipClass: 'jtip'});
 $('a.jt:eq(2)').cluetip({
  cluetipClass: 'jtip', 
  arrows: true, 
  dropShadow: false, 
  height: '150px', 
  sticky: true,
  positionBy: 'bottomTop'  
 });
 $('a.jt:eq(3)').cluetip({local: true, hideLocal: false});
 $('a.jt:eq(4)').cluetip({
  cluetipClass: 'jtip', arrows: true, 
  dropShadow: false, 
  onActivate: function(e) {
   var cb = $('#cb')[0];
   return !cb || cb.checked;
  }
 });
// Rounded Corner theme
 $('ol.rounded a:eq(0)').cluetip({splitTitle: '|', dropShadow: false, cluetipClass: 'rounded', showtitle: false});
 $('ol.rounded a:eq(1)').cluetip({cluetipClass: 'rounded', dropShadow: false, showtitle: false, positionBy: 'mouse'});
 $('ol.rounded a:eq(2)').cluetip({cluetipClass: 'rounded', dropShadow: false, showtitle: false, positionBy: 'bottomTop', topOffset: 70});
 $('ol.rounded a:eq(3)').cluetip({cluetipClass: 'rounded', dropShadow: false, sticky: true, ajaxCache: false, arrows: true});
 $('ol.rounded a:eq(4)').cluetip({cluetipClass: 'rounded', dropShadow: false});  
});

로그인 후 복사

더 많은 jQuery 관련 콘텐츠에 관심이 있는 독자는 이 사이트에서 특별한 주제를 확인할 수 있습니다. "JQuery 날짜 및 시간 조작 기술 요약", "jQuery 스위칭 특수 효과 및 기술 요약 ", "JQuery 드래그 앤 드롭 특수 효과 및 기술 요약", "jQuery 확장 기술 요약", "jQuery Common Classic 특수 효과 요약" , "jQuery 애니메이션 및 특수효과 사용 요약", "jquery 선택기 사용 요약" 및 "jQuery 일반 플러그인 및 사용 요약"

이 기사가 jQuery 프로그래밍에 종사하는 모든 사람에게 도움이 되기를 바랍니다.

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
최신 이슈
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!