Meter un texto en un iframe

  • Autor Autor aberrao
  • Fecha de inicio Fecha de inicio
A

aberrao

Alfa
Social Media
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
A ver si me podeis ayudar.

la idea es meter en un array varias urls con formato Enlace eliminado y despues mostrarlas en pantalla justo encima de donde se visualiza el iframe.

vale, pues a ver si alguien me sugiere alguna idea para que meta las urls encima, porque por más vueltas que le doy al asunto sigo atascado y las urls se visualizan donde no deben







<!DOCTYPE html><html>
<head>
<meta charset="UTF-8">

<style>

iframe {
padding:10px;
border:5px solid pink;
background-color:white;
width:300px;
height:350px;
}

#iframes {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;

-webkit-flex-wrap: wrap;
flex-wrap:wrap;
}


#marco {
background-color: pink;
padding: 10px;
margin: 10px;
border: 3px solid black;
}
</style>

<script type="text/javascript" src="http://zeptojs.com/zepto.min.js" >
</script>
<script type="text/javascript">
$(function(){
var urls = ["http://getbootstrap.com","http://vishub.org"];

function mostrar(urls) {
var i, iframes="";
//var web;
for (i=0; i < urls.length; ++i) {
//aqui se mete el texto con posicion en el array y el iframe

iframes += "URL_"+ i +" "+ urls + " <iframe src='" + urls + "'></iframe> ";
//web += "<br>" + urls;
}
//$('#interior').html(web);
$('#iframes').html(iframes);


};
// añadir url al array
$("#boton").on('click', function(){
urls.push($('#nuevo').val());
mostrar(urls);
});
// borrar url del array
$("#bboton").on('click', function(){
urls.splice($('#baja').val(),1);
mostrar(urls);
});

mostrar(urls);
});
</script>

<script type="text/javascript">

// aqui se podria meter lo de borrar
</script>

</head>

<body>
<h3>Ejemplos de diseño responsivo</h3>

<input type="text" id="nuevo" value="Nuevo URL para añadir" />
<button type="button" id="boton"> Añadir </button>


<input type="text" id="baja" value="Borrar URL" />
<button type="button" id="bboton"> Borrar</button>

<p>
<div id='marco'><div id="iframes"> </div>

</div>



</body>
</html>
 
Atrás
Arriba