javascript代码实例教程-jQuery 弹出层 弹出对话框
发布时间:2019-02-02 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了javascript代码实例教程-jQuery 弹出层 弹出对话框,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。
可以设置大小,ajax内容弹出,背景等各种调整
演示
XML/HT
ML Code
@H_360_11@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <script>
- $(document).ready(function() {
- @L_777_1@yLightbox.inIT({
- override:true,
- background: 'white',
- centerOnReSize: true,
- fade: true
- });
- $('#alert').click(function() {
- alert('Hello');
- });
- $('#hello').click(function() {
- alert('Hello there, my name is ClassyLightbox. Pleasure meeting you.');
- });
- $('#ajax').click(function() {
- ClassyLightbox.alert({
- width: '400px',
- title: 'Ajax Content',
- rightButtons: ['OK'],
- leftButtons: ['Close'],
- oPEned: function() {
- $('').load('demo.html').appendTo('#lbContent');
- },
- onClick: function(button) {
- console.LOG(button);
- }
- });
- });
- $('#buttons').click(function() {
- ClassyLightbox.alert({
- width: '400px',
- title: 'Button Callbacks',
- rightButtons: ['No', 'Yes'],
- leftButtons: ['Close'],
- opened: function() {
- $('').html("rightButtons: ['No', 'Yes'],
leftButtons: ['Close']
").appendTo('#lbContent'); - },
- onClick: function(button) {
- if (button != 'Close') {
- $('#ClassyLightbox #lbContent').append('
Clicked '+button); - }
- console.log(button);
- }
- });
- });
- $('#small').click(function() {
- ClassyLightbox.alert({
- width: '200px',
- title: '200px',
- rightButtons: ['OK'],
- opened: function() {
- $('').html("I am Small.
width: '200px',").appendTo('#lbContent'); - },
- onClick: function(button) {
- console.log(button);
- }
- });
- });
- $('#Draggable').click(function() {
- ClassyLightbox.alert({
- width: '400px',
- title: 'Drag Me Up Here!',
- rightButtons: ['Cool!'],
- opened: function(){
- $('').html("If jquery UI is loaded, all windows will become draggable automagically!").appendTo('#lbContent');
- },
- onClick: function(button) {
- console.log(button);
- if (button == 'Cool!') {
- ClassyLightbox.clear();
- }
- }
- });
- });
- $('#wbgf').click(function() {
- ClassyLightbox.destroy();
- ClassyLightbox.init({
- override:true,
- background: 'white',
- centerOnResize: false,
- fade: true
- });
- alert("Hello World");
- });
- $('#bbgf').click(function() {
- ClassyLightbox.destroy();
- ClassyLightbox.init({
- override:true,
- background: 'black',
- centerOnResize: false,
- fade: true
- });
- alert("Hello World");
- });
- $('#bbg').click(function() {
- ClassyLightbox.destroy();
- ClassyLightbox.init({
- override:true,
- background: ((Math.ceil(Math.random()*2))==2) ? 'white' : 'black',
- centerOnResize: false,
- fade: false
- });
- alert("My background doesn't have to fade in, it can be distracting at times.");
- });
- $('#nobg').click(function() {
- ClassyLightbox.destroy();
- ClassyLightbox.init({
- override:true,
- background: 'none',
- centerOnResize: true,
- fade:false
- });
- alert("I have no background");
- });
- $('#center').click(function() {
- ClassyLightbox.destroy();
- ClassyLightbox.init({
- override:true,
- background:'white',
- centerOnResize: true,
- fade: false
- });
- alert("Resize the window when I am open! I stay centered on resize.");
- });
- });
- </script>
-
-
-
-
原文地址:https://www.freejs.net/article_jquerywenzi_137.html 觉得可用,就经常来吧! 脚本宝典 欢迎评论哦! js脚本,巧夺天工,精雕玉琢。小宝典献丑了!
脚本宝典总结
以上是脚本宝典为你收集整理的javascript代码实例教程-jQuery 弹出层 弹出对话框全部内容,希望文章能够帮你解决javascript代码实例教程-jQuery 弹出层 弹出对话框所遇到的问题。
如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。