Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Popup Window

  1. #1
    harsha.gus is offline Senior Member
    Join Date
    Mar 2009
    Posts
    301

    Exclamation Popup Window

    Hi,

    I would like to add a popup window to my website.

    I added a javascript.

    But I am not sure how to get the content from tables.


    I would like to have a feature like .

    I can edit the content from Mange Topics.
    and that should show up in popup window when i open my website.

    here is the code that i added to my template.ascx

    Code:
    <DIV id=dropin
    		style="LEFT: 200px; VISIBILITY: hidden; WIDTH: 500px; POSITION: absolute; TOP: 100px; HEIGHT: 300px">
    		<TABLE id=tbl
    		style="BORDER-RIGHT: #cccccc thick ridge; BORDER-TOP: #cccccc thick ridge; BORDER-LEFT: #cccccc thick ridge; BORDER-BOTTOM: #cccccc thick ridge; BACKGROUND-COLOR: #ffffff"
    		height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
    		  <TBODY>
    		  <TR>
    		    <TD>
    		      <TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
    		        <TBODY>
    		        <TR>
    		          <TD style="CURSOR: hand" vAlign=top bgColor=#ffffff height=12>
    		            <DIV align=right><A style="FONT-SIZE: 10px; FONT-FAMILY: verdana"
    		            onclick="dismissbox();return false"
    		            href="http://www.packandseal.com/">[<U>Close</U>] </A></DIV></TD></TR>
    		        <TR>
    		          <TD id=dragtext
    		          style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px"
    		          vAlign=top width="100%" bgColor=#ffffff colSpan=2>Sample content
    		            here.</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>
    	<SCRIPT language=Javascript>
    				DropIn('#FFFFFF','Microsoft Sans Serif',14,'#000000','%OFFER1%','290','490','125','225','#0000FF','solid',1,0,false)
    		</SCRIPT>
    I think i am missing something here '%OFFER1%' this is my topic name.

    can i write it like this to pull out the content for my database.
    rbgx
    AspDotNetStorefront ML
    v8.0.1.4

  2. #2
    harsha.gus is offline Senior Member
    Join Date
    Mar 2009
    Posts
    301

    Exclamation Java Script I am Using for it is.

    This is the Java script i am linking to the template.ascx
    var ie=document.all
    var dom=document.getElementById
    var ns4=document.layers
    var ns6=document.getElementById&&!document.all
    var calunits=document.layers? "" : "px"

    var bouncelimit=32 //(must be divisible by 8)
    var direction="up"
    var lpos

    function initbox(){
    if (!dom&&!ie&&!ns4)
    return
    crossobj=(dom)?document.getElementById("dropin").s tyle : ie? document.all.dropin : document.dropin
    scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
    crossobj.top=scroll_top-250+calunits
    crossobj.visibility=(dom||ie)? "visible" : "show"
    dropstart=setInterval("dropin()",50)
    }

    function dropin(){
    scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
    if (parseInt(crossobj.top)<lpos)
    crossobj.top=parseInt(crossobj.top)+25+calunits
    else{
    clearInterval(dropstart)
    bouncestart=setInterval("bouncein()",50)
    }
    }

    function bouncein(){
    crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
    if (bouncelimit<0)
    bouncelimit+=8
    bouncelimit=bouncelimit*-1
    if (bouncelimit==0){
    clearInterval(bouncestart)
    }
    }

    function dismissbox(){
    if (window.bouncestart) clearInterval(bouncestart)
    crossobj.visibility="hidden"
    }

    function truebody(){
    return (document.compatMode!="BackCompat")? document.documentElement : document.body
    }
    function delay(x)
    {
    var d=new Date()
    d=d.getSeconds()+x
    if (d>=60) d=d-60
    while (true)
    {
    var d1=new Date()
    if(d==d1.getSeconds())
    break;
    }
    }
    function SetCooKie(name,value)
    {
    var argv=SetCooKie.arguments;
    var argc=SetCooKie.arguments.length
    var expires=(argc>2) ? argv[2] : null
    var path=(argc>3) ? argv[3] : null
    var domain=(argc>4) ? argv[4] : null
    var secure=(argc>5) ? argv[5] : false
    document.cookie=name + "=" +escape(value) +
    ((expires==null) ? "" ";expires=" + expires.toGMTString())) +
    ((path==null) ? "" ";path=" + path)) +
    ((domain==null) ? "" ";domain=" + domain)) +
    ((secure==true) ? "; secure " : "")

    }
    function DeleteCookie (name,path,domain)
    {
    if (GetCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
    }

    /*function GetCookie(name)
    {
    var arg=name + "="
    var alen=arg.length
    var clen=document.cookie.length
    var i=0
    while((i<clen) && (i>=0))
    {

    var j=i+alen
    if (document.cookie.substring(i,j)==arg)
    {
    //getCookieVal(j)
    return true;
    }
    i=document.cookie.indexOf(" ", i) + i;
    if ( i==0) break;
    }
    return false;
    }*/

    function GetCookie(name)
    {
    var arg=name + "="
    var alen=arg.length
    var clen=document.cookie.length
    var i=0,prev=0;next=0;
    var retval=false;
    while(true)
    {
    next=document.cookie.indexOf("; ", prev);
    if(next<=0)
    {
    var chkval=document.cookie.substring(prev,clen);
    var eqpos=chkval.indexOf("=", 0);
    if(eqpos>0)
    {
    if((chkval.substring(0,eqpos+1))==arg)
    {
    retval=true;
    break;
    }
    }
    break;
    }
    if(next>0)
    {
    var chkval=document.cookie.substring(prev,next);
    var eqpos=chkval.indexOf("=", 0);
    if(eqpos>0)
    {
    if((chkval.substring(0,eqpos+1))==arg)
    {
    retval=true;
    break;
    }
    }

    }
    prev=next+2;
    }
    return retval;
    }


    function getCookieVal(offset)
    {
    var endstr=document.cookie.indexOf(";",offset)
    if(endstr==-1)
    {
    endstr=document.cookie.length;
    }
    return unescape(document.cookie.substring(offset,endstr)) ;

    }
    function Delaynew()
    {
    if (!ns4)
    {
    document.getElementById("dropin").style.visibility ="visible";

    }
    else
    document.dropin.visibility="show";

    return;
    }


    function DropIn(main_bgcolor,main_texttype,main_textsize,ma in_textcolor,textbar,height,width,top,left,borderc olor,borderstyle,borderwidth,sec,showeverytime)
    {
    lpos = top
    ans="no"
    //delay(sec)
    var chkshow=false;
    if (!showeverytime)
    {
    chkshow=GetCookie('IMCCUSTOMER');
    if (!chkshow)
    {
    var d = new Date();
    d.setFullYear(d.getFullYear() + 2);
    document.cookie = "popDropin=" + document.lastModified +
    "; expires=" + d.toGMTString();
    SetCooKie('popDropin','added',d);
    //document.vidFrame.location.href='vid_blank.htm';
    }
    }
    else
    {
    DeleteCookie('popalert1','','');

    }


    if(!chkshow)
    {
    if (ns4)
    {
    templayer=document.layers[0]
    templayer.left=left
    templayer.top=top
    templayer.width=width
    templayer.height=height
    }
    else if (ns6)
    {
    document.getElementById("tbl").style.border = bordercolor+' '+borderwidth+'px '+borderstyle
    document.getElementById("dragtext").innerHTML=text bar

    document.getElementById("dropin").style.height=hei ght +'px'
    document.getElementById("dropin").style.width =width +'px'
    document.getElementById("dropin").style.left =left +'px'
    document.getElementById("dropin").style.top =top +'px'
    document.getElementById("dragtext").style.backgrou ndColor=main_bgcolor
    document.getElementById("dragtext").style.color = main_textcolor
    document.getElementById("dragtext").style.fontFami ly = main_texttype
    document.getElementById("dragtext").style.fontSize = main_textsize+'px'
    }
    else
    {
    document.getElementById("tbl").style.border = bordercolor+' '+borderwidth+'px '+borderstyle
    document.getElementById("dragtext").innerHTML=text bar

    document.getElementById("dropin").style.height=hei ght +'px'
    document.getElementById("dropin").style.width =width +'px'
    document.getElementById("dropin").style.left =left +'px'
    document.getElementById("dropin").style.top =top +'px'
    document.getElementById("dragtext").style.backgrou ndColor=main_bgcolor
    document.getElementById("dragtext").style.color = main_textcolor
    document.getElementById("dragtext").style.fontFami ly = main_texttype
    document.getElementById("dragtext").style.fontSize = main_textsize+'px'
    }
    setTimeout("initbox()",(sec*1000));
    }
    }
    rbgx
    AspDotNetStorefront ML
    v8.0.1.4

  3. #3
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Perhaps this link could help you out: JavaScript Connection to SQL Server