html coding issue

Discussion in 'Web Programming' started by karmik, Mar 31, 2015.

html coding issue
  1. Unread #1 - Mar 31, 2015 at 8:34 PM
  2. karmik
    Joined:
    Dec 14, 2013
    Posts:
    7
    Referrals:
    0
    Sythe Gold:
    0

    karmik Newcomer

    html coding issue

    Hey guys, I was trying to find a way to create an html file that references the oldschool runescape applet url. A

    I'm using iFrame, but it's not really acting right. I can't get the background of the url to match the applet (So that I don't have 2 rectangles that aren't flush with eachother).

    I want to be able to just play with 2 game applets in the same window. I tried to find a way to directly reference the applet itself, but I have no clue where I would start for that.

    I would hope to be able to draw images and information onto the browser with html, that's the purpose of this as well.
     
  3. Unread #2 - Mar 31, 2015 at 9:14 PM
  4. CompileTime
    Joined:
    Apr 16, 2014
    Posts:
    451
    Referrals:
    0
    Sythe Gold:
    3

    CompileTime Professional desktop/web application developer.
    Banned

    html coding issue

    Code:
    <!DOCTYPE HTML>
    <html>
    	<iframe src="http://oldschool18.runescape.com/j1" width="800" height="550" ></iframe>	
    	<iframe src="http://oldschool18.runescape.com/j1" width="800" height="550" ></iframe>
    </html>
    And here's the result.
     
  5. Unread #3 - Apr 1, 2015 at 5:22 AM
  6. karmik
    Joined:
    Dec 14, 2013
    Posts:
    7
    Referrals:
    0
    Sythe Gold:
    0

    karmik Newcomer

    html coding issue

    Okay, I've gotten this:

    Code:
    <html style="background-color: #F48;"><head>
    
    </head>
    <body>		
    	
    
    	
    <div id="content">
        <div>
    	<button id="b1A" onclick="rs1switch()" style="top:0; left:0; position:absolute;">SWITCH(MEM)</button>
            <iframe id="rs1" src="http://oldschool30.runescape.com/"  onload="this.style.visibility'visible';"
                frameborder="0" height="100%" width="100%" style="position:absolute; 					
    			clip:rect(150px,1095px,650px,340px);
                top:10; left:0px;"></iframe>
        </div>
    	
    	    <div>
    	<button id="b2A" onclick="rs2switch()" style="top:0; left:0; position:absolute;">SWITCH(MEM)</button>
            <iframe id="rs2" src="http://oldschool30.runescape.com/"  onload="this.style.visibility'visible';"
                frameborder="0" height="100%" width="100%" style="position:absolute; 					
    			clip:rect(150px,1095px,650px,340px);
                top:10; left:0px;"></iframe>
        </div>
    
    	
    </div>
    		
    	<script type="text/javascript">
    		
    			var rs1y = -140;
    			var rs1hold= 1;
    			document.getElementById("rs1").style.top=rs1y;			
    			document.getElementById("b1A").style.top=rs1y+200+150;
    			document.getElementById("b1A").style.left=170;		
    			
    			function rs1switch(){
    				if(rs1hold==0){
    					document.getElementById("b1A").innerHTML = "SWITCH(MEM)";
    					rs1hold = 1;
    					document.getElementById("rs1").style.top = rs1y;
    					document.getElementById("rs1").style.clip = "rect(150px,1095px,650px,340px)";
    				}else{
    					document.getElementById("b1A").innerHTML = "SWITCH(F2P)";
    					document.getElementById("rs1").style.clip = "rect(32px,1095px,532px,340px)";
    					document.getElementById("rs1").style.top = rs1y+118;
    					rs1hold=0;				
    				}		
    			}
    			
    			var rs2y = -140+503;
    			var rs2hold= 1;
    			document.getElementById("rs2").style.top=rs2y;			
    			document.getElementById("b2A").style.top=rs2y+200+150;
    			document.getElementById("b2A").style.left=170;		
    			
    			function rs2switch(){
    				if(rs2hold==0){
    					document.getElementById("b2A").innerHTML = "SWITCH(MEM)";
    					rs2hold = 1;
    					document.getElementById("rs2").style.top = rs2y;
    					document.getElementById("rs2").style.clip = "rect(150px,1105px,650px,340px)";
    				}else{
    					document.getElementById("b2A").innerHTML = "SWITCH(F2P)";
    					document.getElementById("rs2").style.clip = "rect(32px,1105px,532px,340px)";
    					document.getElementById("rs2").style.top = rs2y+118;
    					rs2hold=0;				
    				}		
    			}
    			
    	</script>
    		
    		 
    </body></html>
    
    

    It seems to flicker a bit much.
    I guess that's just because applets :\
     
  7. Unread #4 - Apr 2, 2015 at 3:36 AM
  8. karmik
    Joined:
    Dec 14, 2013
    Posts:
    7
    Referrals:
    0
    Sythe Gold:
    0

    karmik Newcomer

    html coding issue

    Okay, so I've been working on it for a while now. If you're using chrome, I have it able to do this:

    Code:
    <html>
    <head>
    
    </head>
    <body>
    <div style="position:fixed; width:100%; height:100%; top:0;left:0; background-color:#000; z-index:2"></div>
    
    <div id="master" style="position:absolute; top:-150; left:200;">
    
    
    <div id="diva" style="position:relative; height:503;">
    	<iframe id="rs1" onload="this.value=0"  rc="http://oldschool30.runescape.com/" scrolling="no" 
    		style="position:relative; width:765;  height:668; border:0">
    	</iframe>
    </div>
    
    <div id="divb"style="position:relative;height:503;">
    	<iframe id="rs2" onload="this.value=0" src="http://oldschool30.runescape.com/" scrolling="no" 
    		style="position:relative; width:765; height:668; border:0"
    	></iframe>
    </div>
    
    
    	<div id="buttons" style="position:absolute; z-index:3; top:200; left:-200">
    		<button 
    		id="b1" 
    		value= "1" 
    		onclick="slide('rs1')" 
    		style="position:absolute; z-index:3; top:0; left:60">	
    			test		
    		</button>
    		
    		<button 
    		id="b2" 
    		value= "2"
    		onclick="slide('rs2')" 
    		style="position:absolute; z-index:3; top:0; left:60">	
    			test		
    		</button>
    		
    	</div>
    </div>
    
    
    
    <script>
    
    
    
    	var buttonA = document.getElementById("b1");
    	var buttonB = document.getElementById("b2");
    	var offset = 503-150;
    	buttonA.style.top=((1*503)-offset);
    	buttonB.style.top=((2*503)-offset);
    	
    	
    	function setvalue(elem,set){
    		elem.value=set;
    	}
    	function slide(elemname){
    		var elem = document.getElementById(elemname);		
    		if(elem.value=="0"){
    		elem.value="1";
    		elem.style.top="118";
    		}else{
    		elem.value="0";
    		elem.style.top="0";
    		}
    		
    		
    		if(elemname=="rs1" && elem.value=="1"){
    			document.getElementById("master").style.top="-128";
    		}else if(elemname=="rs1" && elem.value=="0"){
    			document.getElementById("master").style.top="-150";		
    			}
    	}
    
    
    </script>
    
    </body>
    </html>
     
  9. Unread #5 - Apr 2, 2015 at 4:50 AM
  10. Virtual
    Joined:
    Jan 25, 2013
    Posts:
    1,250
    Referrals:
    1
    Sythe Gold:
    226
    Two Factor Authentication User Halloween 2015 Easter 2015 Sythe's 10th Anniversary

    Virtual Guru
    $25 USD Donor New

    html coding issue

    Instead of using an iframe (for maximum customing) you can just post the java applet and make the jar reference to the original jar file. Don't forget to put all parameters as well
     
  11. Unread #6 - Apr 2, 2015 at 6:02 AM
  12. karmik
    Joined:
    Dec 14, 2013
    Posts:
    7
    Referrals:
    0
    Sythe Gold:
    0

    karmik Newcomer

    html coding issue

    I have no idea how to actually do that :( I've been trying to do that before I started using iframes.

    anyway, I got this far:

    I can put in as many applets as I want now, and use the tabs on the side to shift applets in place, up or down.
    Code:
    <html>
    <head>
    
    </head>
    <body style="overflow:hidden">
    <div style="position:fixed; width:100%; height:400%; top:0;left:0; background-color:#000; z-index:1"></div>
    
    <div id="master" style="position:absolute; top:-160; left:200;">
    	<div id="diva" style="position:relative; height:503;">
    		<iframe id="rs1" onload="this.value=0"  src="http://oldschool30.runescape.com/" scrolling="no" 
    			style="position:relative; width:765;  height:668; border:0">
    		</iframe>
    	</div>
    
    	<div id="divb" style="position:relative;height:503;">
    		<iframe id="rs2" onload="this.value=0" src="http://oldschool30.runescape.com/" scrolling="no" 
    			style="position:relative; width:765; height:668; border:0"
    		></iframe>	
    	</div>
    	<div id="buttons" style="position:absolute; z-index:3; top:200; left:-200">
    		<button 
    		id="b1" 
    		value= "1" 
    		onclick="slide('rs1','b1')" 
    		style="position:absolute; z-index:3; top:0; left:60">	
    			(MEMS)		
    		</button>
    		
    		<button 
    		id="b2" 
    		value= "1"
    		onclick="slide('rs2','b2')" 
    		style="position:absolute; z-index:3; top:0; left:60">	
    			(MEMS)		
    		</button>		
    	</div>
    	
    	
    	<div id="above" style="position:fixed; top:250; left:980; 
    		height:150; width:200; z-index:2; background-color: #843"
    		onclick="moveup()">
    	</div>
    
    	<div id="below" style="position:fixed; top:512; left:980; 
    		height:150; width:200; z-index:2; background-color: #843"
    		onclick="movedown()">
    	</div>
    	
    </div>
    
    	<div id="side" style="position:fixed; top:0; left:1180; width:300; height:100%; z-index:3; background-color: #750"></div>
    
    <script>
    	var buttonA = document.getElementById("b1");
    	var buttonB = document.getElementById("b2");
    	var offset = 503-150;
    	buttonA.style.top=((1*503)-offset);
    	buttonB.style.top=((2*503)-offset);
    	
    	var masterxoffset = 0;	
    	function setvalue(elem,set){
    		elem.value=set;
    	}
    	function slide(elemname,bn){
    		var elem = document.getElementById(elemname);		
    		var but = document.getElementById(bn);
    		if(elem.value=="0"){
    		elem.value="1";
    		elem.style.top="118";
    		but.innerHTML="(LOGIN|F2P)"
    		}else{
    		elem.value="0";
    		elem.style.top="0";
    		but.innerHTML="(MEMS)"
    		}	
    		if(elemname=="rs1" && elem.value=="1"){
    			document.getElementById("master").style.top=-128;
    			document.getElementById("buttons").style.top=(200+118-150);
    		}else if(elemname=="rs1" && elem.value=="0"){
    			document.getElementById("master").style.top=-150;
    			document.getElementById("buttons").style.top=(200+140-150);		
    		}
    	}
    	
    	function setmasterx(xoff){
    		masterxoffset=xoff;
    		mast = document.getElementById("master");
    		var mtop = parseInt(mast.style.top);
    		mast.style.top=mtop+xoff;
    	}
    	
    </script>
    
    <script>
    
    var level = 1;
    
    
    
    function moveup(){
    	if(level == 1){
    		
    	}else{
    		level=level-1;
    		setmasterx(503);
    	}
    	
    }
    
    function movedown(){
    	if(level == 2){
    	
    	}else{
    		level=level+1;
    		setmasterx(-503);
    	}
    }
    
    	var px,py;
    	var downy = 0;
    	var mousedown=false;
    	var elemside = document.getElementById("side");
    	
    	var downyb = 0;
    	
    	elemside.onmousemove= function(e){	
    		e = e||window.event;
    		
    		if(mousedown){
    			setmasterx(e.clientY-py);
    		}
    		
    		px = e.clientX;
    		py = e.clientY;
    		
    
    
    	};
    	elemside.onmouseout= function(e){
    		e= e||window.event;
    		mousedown=false;
    	}
    	elemside.onmousedown= function(e){
    		e= e||window.event;
    		downy = e.clientY;
    		downyb = 0;
    		mousedown=true;
    	}
    	elemside.onmouseup= function(e){
    		e= e||window.event;
    		mousedown=false;
    	}
    
    	
    
    </script>
    
    </body>
    </html>
    

    If you showed me how to use the oldschool applet through an external html document, I'd really like that :)
     
< [REQUEST] Need help with a little quick signature coding | Need Web coder- Big money. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site