PDA

View Full Version : سوال: چطوری میشه با jquery این کارو کرد



reza4359
سه شنبه 24 اسفند 1389, 14:47 عصر
سلام دوستان این سایت چطوری این کارو کرده اگه میشه برام یه مثال بزنید
http://www.borujerd-samacollege.ir/Default.aspx
به قسمت برد گروها داخل منوی سمت راست مراجعه کنید
یه div باز میشه که لینک میشه به یه صفحه ولی نمیدونم چطوری این کار رو بکنم اگه میشه کمکم کنید
ممنون

ricky22
سه شنبه 24 اسفند 1389, 17:29 عصر
سلام.
می شه با jQuery Ui Dialog پیاده سازی کرد و Modal هم باید True باشد.
چند مثال :
http://jqueryui.com/demos/dialog/
یک گزینه دیگر :
http://colorpowered.com/colorbox/
موفق باشید.

reza4359
چهارشنبه 25 اسفند 1389, 00:38 صبح
سلام من کدشو با کمک شما پیدا کردم حالا میخوام به جای نشان دادن یک show dialog که پیش فرض خودشه
میخوام یه div رو فراخوانی کنم یا یه صفحه رو درابعاد کوچک فراخوانی کنم حالا باید چکار کنم
اینم کدی که یک show dialog رونشون میده حالا میخوام به موارد بالا تغییرش بدم

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="jquery-ui.min.js" type="text/javascript"></script>
<link href="jquery-ui.css" rel="stylesheet" type="text/css" />


<script type="text/javascript">
$(document).ready(function () {
$('span#jQueryVersion').html($().jquery);
});

function dialogContent() {
var withScript = ($('#withScript').val() == 'true');

var content = '<div><div id="dialogContent">\r\n';
if (withScript) {
content += '<sc' + 'ript type="text/javascript">\r\n';
content += '$(document).ready(function() {\r\n';
content += '$("input#Edit_FirstName").focus();\r\n';
content += '});\r\n';
content += '</sc' + 'ript>\r\n';
}

content += '<h3>Enter Name</h3><div><label for="Edit_FirstName">First: </label><input id="Edit_FirstName" type="text"></div><div><label for="Edit_LastName">Last: </label><input id="Edit_LastName" type="text"></div></div><hr/>';

if ($().jquery == '1.3.2') {
content += 'Since we are using jQuery version 1.3.2 everything is working normally'
}
else if (($().jquery == '1.4.1') || ($().jquery == '1.4.2')) {
if (withScript) {
content += 'With jQuery version ' + $().jquery + ' including script tags in the content will cause problems<ul><li>In IE8 it produces an "unspecified error"</li><li>In Firefox3 there is no error but it shows two dialog boxes, one on top of the other</li></ul>';
}
else {
content += 'Since this dialog doesn\'t have a script tag it is working normally';
}
}
else {
content += 'Not using version 1.3.2, 1.4.1 or 1.4.2 of jQuery, so I really have no idea what will happen';
}
content += '</div>';

return content;
}

function showDialog() {

var dialogOptions = {
autoOpen: true,
width: 300,
modal: true,
title: 'Dialog',
closeOnEscape: false
};

$(dialogContent()).dialog(dialogOptions);
}

</script>

</head>
<body>





<a href="#" onclick="showDialog();">Show Dialog</a>





</body>
</html>

mehdi_php
یک شنبه 29 اسفند 1389, 13:10 عصر
67718

من یک پلاگین برای این کار نوشتم ساده و تمیز هست .



$(function(){
$('a').box();
//يا
$('#link').box();
//box get url in href att and open in modal box ;)
}) ;

reza4359
یک شنبه 29 اسفند 1389, 19:40 عصر
ممنون ولی این کار نمیکنه میشه خودتون یه مثال باهاش بزنید