Hi friends,
I had an element as:
[CODE]
<%
a=0
set get_proj=baglan.execute(“select * from projeler”)
while not get_proj.eof
a=a+1
%>
<div class=”<%=get_proj(“pcat”)%>kutu”>
<div id=”<%=get_proj(“pcode”)%>” > <a href=”<%=get_proj(“plink”)%>” onclick=”sara_f<%=get_proj(“pshort_name”)%>();return false;”><img src=”png_thumb/<%=get_proj(“pmin_img”)%>” class=”kutu” /></a> </div>
</div>
<%
get_proj.movenext
wend
get_proj.close
set get_proj=nothing
%>
and function for it:
[CODE]
<%
set get_proj3=baglan.execute(“select * from projeler”)
while not get_proj3.eof
%>
//this function opens the window I’ve reated
function sara_f<%=get_proj3(“pshort_name”)%>(){
$(‘bahr_kutu’).morph(‘ height:690px;width:1260px;’);
$(‘bahr_kutu’).insert(‘<div id=”bahr_frameicerik”></div>’);
$(‘bahr_projeadi’).replace(‘<div id=”bahr_projeadi”><%=get_proj3(“pfull_name”)%></div>’);
$(‘bahr_projeyilyer’).replace(‘<div id=”bahr_projeyilyer”><%=get_proj3(“pwhere”)%>-<%=get_proj3(“pyear”)%></div>’);
setTimeout(function(){$(‘bahr_frameicerik’).insert(‘<iframe name=”bahr_frame” src=”<%=get_proj3(“plink”)%>” allowtransparency=”true” width=”100%” height=”100%” scrolling=”no” frameborder=”0″ /> ‘);},1000);
}
<%
get_proj3.movenext
wend
get_proj3.close
set get_proj3=nothing
%>
This worked fine!,but
as you see I created a endless function for endless elements,that causes page shrink. As I am started to learn javascript and asp for new, a few days ago I attempted to learn how to create global functions:
So I tried to create this:
[CODE]
function [COLOR=”Blue”]kutular_fonk[/COLOR]( [COLOR=”Red”]pfullname, plink, pwhere, pyear[/COLOR] ){
$(‘bahr_kutuoverlay’).setStyle({‘display’:’block’});
$(‘bahr_kutu’).morph(‘height:690px;width:1260px’);
$(‘bahr_kutu’).insert(‘<div id=”bahr_frameicerik”></div>’);
$(‘bahr_projeadi’).replace(‘<div id=”bahr_projeadi”> [COLOR=”Red”]pfullname[/COLOR] </div>’);
$(‘bahr_projeyilyer’).replace(‘<div id=”bahr_projeyilyer”> [COLOR=”Red”]pwhere – pyear[/COLOR] </div>’);
setTimeout(function(){$(‘bahr_frameicerik’).insert(‘<iframe name=”bahr_frame” src=[COLOR=”Red”]plink[/COLOR] allowtransparency=”true” width=”100%” height=”100%” scrolling=”no” frameborder=”0″ /> ‘);},1000);
}
function is not looping any more.
I edited element for it as:
[CODE]
<%
a=0
set get_proj=baglan.execute(“select * from projeler”)
while not get_proj.eof
a=a+1
%>
<div class=”<%=get_proj(“pcat”)%>kutu”>
<div id=”<%=get_proj(“pcode”)%>”><a href=”#” onclick=”[COLOR=”Blue”]kutular_fonk[/COLOR](“<%=get_proj(“pfull_name”)%>”,”<%=get_proj(“plink”)%>”,”<%=get_proj(“pwhere”)%>”); return false;”> <img src=”png_thumb/<%=get_proj(“pmin_img”)%>” class=”kutu” /></a> </div>
</div>
<%
get_proj.movenext
wend
get_proj.close
set get_proj=nothing
%>
the result gives:
[CODE]
<div class=”yonetimkutu”>
<div id=”yonk_korfezticaret”><a href=”#” onclick=”kutular_fonk(“Körfez Ticaret Odası”,”http://www.mypage.com/dene640.jpg”,”Kocaeli”); return false;”> <img src=”png_thumb/3_thumb.png” class=”kutu” /></a> </div>
</div>
But it causes syntax error at kutular_fonk.
please help.