PDA

View Full Version : ایجاد به windos application درون web



setarehman
جمعه 26 اسفند 1384, 12:20 عصر
من میخوام وقتی روی یه لینک کلیک شد یه فرم ویندوزی رو نشون بده نه یه webform
چه جوری باید این فرم رو به وجود اورد یه میشه همون web form رو تغییر داد که شبیه به فرم ویندوزی بشه که هیچ منو و عنوانی بالای فرم نباشه و فقط کلید * داشته باشه بالاش

iekrang
جمعه 26 اسفند 1384, 17:37 عصر
شما با openwindow میتونید اینکار رو انجام بدید.من یه مثال خیلی کامل در این مورد پیدا کردم. اگه متوجه نشدید بفرمایید.


Script Extra - Script to facilitate opening windows.
--------------------------------------------------------------------------------

I've created a function to simplify the creation of making windows. You just "feed" it the values you'd like and the script takes care of the hard part.
function openWindow(url,w,h,tb,stb,l,mb,sb,rs,x,y){
var t=(document.layers)? ',screenX='+x+',screenY='+y: ',left='+x+',top='+y; //A LITTLE CROSS-BROWSER CODE FOR WINDOW POSITIONING
tb=(tb)?'yes':'no'; stb=(stb)?'yes':'no'; l=(l)?'yes':'no'; mb=(mb)?'yes':'no'; sb=(sb)?'yes':'no'; rs=(rs)?'yes':'no';
var x=window.open(url, 'newWin'+new Date().getTime(), 'scrollbars='+sb+',width='+w+',height='+h+',toolba r='+tb+',status='+stb+',menubar='+mb+',links='+l+' ,resizable='+rs+t);
x.focus();
}

Example: This link opens a new window using the code above.

You would call this function by using a pseudo url like: <a href="javascript:openWindow( 'http://scriptasylum.com', 200, 200 ,0 ,0 ,0 ,0 ,0 ,1 ,10 ,10 )">Link text here</a>
Usage: openWindow( url , w , h , tb , stb , L , mb , sb , rs , x , y )


url - The URL of the page to open. Example: "http://scriptasylum.com".
w - The width of the window in pixels.
h - The height of the window in pixels (doesn't include menubars).
tb - Toolbar visible? 1 = yes, 0 = no.
stb - Status bar visible? 1 = yes, 0 = no.
L - Linkbar visible? 1 = yes, 0 = no.
mb - Menubar visible? 1 = yes, 0 = no.
sb - Scrollbars visible? 1 = yes, 0 = no.
rs - Resizable window? 1 = yes, 0 = no.
x - The horizontal position of the window from the left of the screen.
y - The vertical position of the window from the top of the screen.
Many times, if windows are opened in this manner, there is usually some method of closing the window with a button or a simple text link (images work too). Here's how that is done:

<form><input type="button" value="Close" onClick="self.close()"></form>
or
<a href="javascript:self.close()">Close me</a>

Either way, the process is similar, both of them use the self.close() javascript method.

Note that you cannot do this in example 1. You can only close a window using javascript if the window was created using javascript. Some browsers do not follow this rule though, but for full compliance across browsers, I recommend sticking to the rules.

hmm
شنبه 27 اسفند 1384, 07:41 صبح
یه نمونه رو اینجا میگذاری؟

iekrang
شنبه 27 اسفند 1384, 09:48 صبح
<html>
<head>
<script language="JavaScript"><!--
//Tour Window
function openTourWindow(url, width, height) {
var Win = window.open (url,"OpenTourWindow",'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no,resizabl e=no,scrollbars=no,statusbar=no,left=200,top=150') ;
}
// -->
</script>
</head>

<body>
<h4>
<a target="_self" href="javaScript:openTourWindow('http://www.barnamenevis.org/forum',300,300);">
برنامه نویس</a></h4>

</body>
</html>