PDA

View Full Version : java script در جدولهای front page



samane_r
شنبه 24 آبان 1382, 16:54 عصر
باسلام
چطوری می شه که یک برنامه java script (مثلا یک منو) را در یکی از خانه های جدول قرار داد
من دستی code را وارد می کنم ولی دقیقا در جدول قرار نمی گیره یعنی اصلا در جدول قرار نمی گیره .آیا componentی آماده در خود front page برای این کار وجود داره که بشه بوسیله اون کد جاوا اسکریپت رو وارد نمود ؟
مشکل دیگه من اینه که وقتی منوها باز می شوند دنباله اون در زیر فایل فلشی که در خانه پایینی جدول قرار داره مخفی می شوند.
خواهش می کنم کمکم کنید :oops:

samane_r
دوشنبه 26 آبان 1382, 10:05 صبح
آقا کسی نیست جواب منو بده :cry:

الهام تفریشی
دوشنبه 26 آبان 1382, 10:58 صبح
خوب بریم سر سوال اول
ببینید
منویی که شما الان دارین میگین در واقع نمیتونین با نوشتن کد در جدول بگین که توی اون جدول بیفته
تو خود کد جاووای مربوطه جایی هست که میزان فاصله منو از بالای صفحه رو تنظیم میکنه
تو باید اونو پیدا کنی و درواقع اندازه Y رو تنظیم کنی

سوال دوم
چون شما از منویی که دارین استفاده میکنین که زیر منوی اون باید توی یه صفحه دیگه صدا بشه یعنی مثلا توی یه frame, Iframe
شما تو همون صفحه ای که منو رو قرار میدین یه Iframe بذارین و تو کد جاوا تون یه قسمت داره که باید اسم این iframe رو بگین

حالا دوست عزیز خواستی کد جوات رو بفرست برام تا بهت بگم کجاهاش رو ست کنی

samane_r
دوشنبه 26 آبان 1382, 11:37 صبح
این هم کد صفحه ی من . فقط در جاهایی که گفتم یک فایل swf یا gif قرار دهید حتما این کار را انجام دهید و نتیجه را مشاهده کنید .
لطفا مرا هم خبر کنید. :oops:



<head>
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>page1</title>
</head>
<table align="center" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="70%" id="AutoNumber1" height="488">
<tr>
<td width="100%" height="488" align="center" valign="top" style="border-style: solid; border-width: 1; ">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="97%" id="AutoNumber2" height="27" bgcolor="#FFFFFF">
<tr>
<td width="7%" height="27" align="center" valign="top" style="border-style:solid; border-width:1; ">
<span lang="fa">ا<font face="Arial" color="#800000">ینجا هم یک عکس</font></span></td>
<td width="108%" height="27" align="center" style="border-top: 1px solid #111111; border-bottom-style: solid; border-bottom-width: 1; ">
<font face="Arial" color="#FF0000"><span lang="fa">اینجا یک عکس</span></font></td>
<td width="32%" height="27" align="center" valign="top" style="border-top: 1px solid #111111; border-bottom-style: solid; border-bottom-width: 1; border-left-style:solid; border-left-width:1; border-right-style:solid; border-right-width:1">
<font face="Arial" color="#FF0000"><span lang="fa">اینجا یک عکس</span></font></td>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0" style="border-width:0; border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3" height="1">

<HTML>
<HEAD><TITLE> Scripts</TITLE>
</HEAD>
<BODY>
<style>
body{background-color:#FFFFFF}
A{color:Navy; text-decoration:none; font-size:8pt}
A:hover{color:red; font-size:8pt}
A:visited:{color:#808080}
TD{font-family:arial,helvetica; font-size:10pt}
DIV.clTopMenu{position:absolute; width:101; height:150; clip:rect(0,101,14,0); visibility:hidden; z-index:31; layer-background-color:#EEEEEE; background-color:#EEEEEE}
DIV.clTopMenuBottom{position:absolute; width:101; height:3; clip:rect(0,101,3,0); top:11; layer-background-color:#CECFCE; background-color:#CECFCE; z-index:2}
DIV.clTopMenuText{position:absolute; width:91; left:5; top:15; font-family:arial,helvetica; font-size:11px; background-color:#EEEEEE; z-index:1}
</style>
<script>
ie=document.all?1:0
n=document.layers?1:0

var numberOfMenus=2
var mwidth=101
var pxBetween=10
var fromLeft=150
var fromTop=70
var bgColor='#CECFCE'
var bgColorChangeTo='#6380BC'
var imageHeight=11
function makeNewsMenu(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+ob j+'.style')
this.scrollHeight=n?this.css.document.height:eval( 'document.all.'+obj+'.offsetHeight')
this.moveIt=b_moveIt;this.bgChange=b_bgChange;
this.slideUp=b_slideUp; this.slideDown=b_slideDown;
this.clipTo=b_clipTo;
this.obj = obj + "Object"; eval(this.obj + "=this")
}
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}
function b_bgChange(color){if(ie) this.css.backgroundColor=color; else this.css.bgColor=color}
function b_clipTo(t,r,b,l){
if(n){this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l
}else this.css.clip="rect("+t+","+r+","+b+","+l+")";
}
function b_slideUp(ystop,moveby,speed,fn,wh){
if(!this.slideactive){
if(this.y>ystop){
this.moveIt(this.x,this.y-5); eval(wh)
setTimeout(this.obj+".slideUp("+ystop+","+moveby+","+speed+",'"+fn+"','"+wh+"')",speed)
}else{
this.slideactive=false; this.moveIt(0,ystop); eval(fn)
}
}
}
function b_slideDown(ystop,moveby,speed,fn,wh){
if(!this.slideactive){
if(this.y<ystop){
this.moveIt(this.x,this.y+5); eval(wh)
setTimeout(this.obj+".slideDown("+ystop+","+moveby+","+speed+",'"+fn+"','"+wh+"')",speed)
}else{
this.slideactive=false; this.moveIt(0,ystop); eval(fn)
}
}
}
function newsMenuInit(){
oTopMenu=new Array()
for(i=0;i<=numberOfMenus;i++){
oTopMenu[i]=new Array()
oTopMenu[i][0]=new makeNewsMenu('divTopMenu'+i)
oTopMenu[i][1]=new makeNewsMenu('divTopMenuBottom'+i,'divTopMenu'+i)
oTopMenu[i][2]=new makeNewsMenu('divTopMenuText'+i,'divTopMenu'+i)
oTopMenu[i][1].moveIt(0,imageHeight)
oTopMenu[i][0].clipTo(0,mwidth,imageHeight+3,0)
oTopMenu[i][0].moveIt(i*mwidth+fromLeft+(i*pxBetwe en),fromTop)
oTopMenu[i][0].css.visibility="visible"
}
}

function topMenu(num){
if(oTopMenu[num][1].y==imageHeight) oTopMenu[num][1].slideDown(oTopMenu[num][2].scroll Height+20,10,40,'oTopMenu['+num+'][0].clipTo(0,mwi dth,oTopMenu['+num+'][1].y+3,0)','oTopMenu['+num+' ][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0 )')
else if(oTopMenu[num][1].y==oTopMenu[num][2].scrollHeig ht+20) oTopMenu[num][1].slideUp(imageHeight,10,40,'oTopMe nu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1 ].y+3,0)','oTopMenu['+num+'][0].clipTo(0,mwidth,oT opMenu['+num+'][1].y+3,0)')
}

function menuOver(num){oTopMenu[num][1].bgChange(bgColorCha ngeTo)}
function menuOut(num){oTopMenu[num][1].bgChange(bgColor)}



onload=newsMenuInit;
</script>

<!-- Remember the "news" "key control" and "page contols" text are images, you probably want to change those
with your own images. If your own images have different sizes please adjust the height and clips
of the divs, and change the imageHeight variable in the script. Good luck -->
<div id="divTopMenu0" class="clTopMenu"><a href="#" onmouseover="menuOver(0)" onmouseout="menuOut(0)" onclick="topMenu(0); if(ie)this.blur(); return false"><img src="news.gif" width=101 height=11 alt="" border=0 align="top"></a>
<div id="divTopMenuText0" class="clTopMenuText">
Added some link to this menu<br><br>
<A HREF="http://www.AceJS.com">AceJS.com</a><BR>
Remember to join our newsletter!
</div>
<div id="divTopMenuBottom0" class="clTopMenuBottom"></div>
</div>

<div id="divTopMenu1" class="clTopMenu"><a href="#" onmouseover="menuOver(1)" onmouseout="menuOut(1)" onclick="topMenu(1); if(ie)this.blur(); return false"><img src="keycontrol.gif" width=101 height=11 alt="" border=0 align="top"></a>
<div id="divTopMenuText1" class="clTopMenuText">
You can change the above images to suit you menu.
<BR><BR>
You an use images (icons) in these menus.<BR>
Check out our <BR><A HREF="http://www.AceJS.com/icons.html">Icons Page</A>
</div>
<div id="divTopMenuBottom1" class="clTopMenuBottom"></div>
</div>
<div id="divTopMenu2" class="clTopMenu"><a href="#" onmouseover="menuOver(2)" onmouseout="menuOut(2)" onclick="topMenu(2); if(ie)this.blur(); return false"><img src="pagecontrol.gif" width=101 height=11 alt="" border=0 align="top"></a>
<div id="divTopMenuText2" class="clTopMenuText">
This one is just like the other ones.<BR>
Add some links to this menu and it will look much better!
</div>
<div id="divTopMenuBottom2" class="clTopMenuBottom"></div>
</div>
<!-- To add a new menu just copy these lines:
<div id="divTopMenuN" class="clTopMenu"><a href="#" onmouseover="menuOver(N)" onmouseout="menuOut(N)" onclick="topMenu(N); if(ie)this.blur(); return false">HEADING IMAGE GOES HERE</a>
<div id="divTopMenuTextN" class="clTopMenuText">
TEXT HERE
</div>
<div id="divTopMenuBottomN" class="clTopMenuBottom"></div>
</div>
And change the letter N to a number higher then the last menu...
(and remember to set the variable numberOfMenus in the script to
the same number of menus you have (remember it starts counting
at 0) -->


</BODY>
</HTML>

</td>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="100%" id="AutoNumber4" height="1027">
<tr>
<td width="12%" height="1027" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top: 1px solid #111111; border-bottom: 1px solid #111111; " align="center" valign="top">
 <p> </p>
<p> </p>
<p> </p>
<p><span lang="fa"><font face="Arial" color="#FF0000">ا</font></span><font face="Arial" color="#FF0000"><span lang="fa">ینج
یک فایل فلش قرار دهید</span></font></td>
<td width="78%" height="1027" style="border-style: none; border-width: medium" align="center" valign="top">

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; " bordercolor="#111111" width="100%" id="AutoNumber5" height="1025">
<tr>
<td width="100%" height="1025" style="border-style: solid; border-width: 1; " align="center" valign="top">
<iframe name="fm1" frameborder=1 width=100% height="121%"
src="html آدرس یک صفحه "></iframe>
</td>
</tr>
</table>
</td>
<td width="10%" height="1027" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top: medium none #111111; border-bottom: medium none #111111"> </td>
</tr>
</table>
</table>
</font></b>
</body>
</html>

samane_r
چهارشنبه 28 آبان 1382, 17:59 عصر
من کدم رو فرستادم ولی جوابی دریافت نکردم :roll:

Anti_Evil
پنج شنبه 29 آبان 1382, 02:16 صبح
من کدم رو فرستادم ولی جوابی دریافت نکردم :roll:

فکر میکنم جواب خانوم الهام تفرشی کامل بید :roll: :oops:

samane_r
شنبه 01 آذر 1382, 06:41 صبح
حالا دوست عزیز خواستی کد جوات رو بفرست برام تا بهت بگم کجاهاش رو ست کنی
خوب به خاطر همین جمله من کدم رو فرستادم ولی انگار ایشون یادشون رفته . :roll:

الهام تفریشی
شنبه 01 آذر 1382, 09:34 صبح
خوب به خاطر همین جمله من کدم رو فرستادم ولی انگار ایشون یادشون رفته
نه دوست عزیز
یادم نرفته
باور کن سرم شلوغه
چشم بروی چشمم