Foros del Web » Programando para Internet » Javascript »

alguien sabe por que no funciona

Estas en el tema de alguien sabe por que no funciona en el foro de Javascript en Foros del Web. Hola a todos la cuestion es que no se por que no funciona una determinada linea espero que estudes sepan por que les añado el ...
  #1 (permalink)  
Antiguo 06/03/2007, 07:28
 
Fecha de Ingreso: marzo-2007
Mensajes: 751
Antigüedad: 17 años, 2 meses
Puntos: 4
alguien sabe por que no funciona

Hola a todos la cuestion es que no se por que no funciona una determinada linea espero que estudes sepan por que les añado el codigo entero en dos comentarios

<html><head>
<style type="text/css"><!--

.slideshow {
list-style-type: none;
margin: 0px;
padding: 0px;
}

.slide {
position: relative;
float: left;
width: 172px;
margin-bottom: 10px;
margin-right: 10px;
}

.slide div.thumb {
background: #fff;
width: 170px;
height: 120px;
border: 1px solid #000;
font-size: 5px;
font-family: "Times New Roman", serif;
overflow: hidden;
}

.slide .view {
padding: 2px 2px;
margin: 2px 0px;
cursor: text;
border-width: 1px;
border-style: solid;
border-color: #ccc;
background-color: #eee;
height: 1em;
}
.view:hover {
background-color: #ffffcc;
}
.view, .inplace, #list5 input {
font-size: 14px;
font-family: sans-serif;
}

.inplace {
position: absolute;
visibility: hidden;
z-index: 10000;
}
.inplace, #list5 input:hover, #list5 input:focus {
background-color: #ffffcc;
}
#slideEditors input.inplace {
width: 12em;
max-width: 12em;
margin-left: 1px;
}
#slideEditors input.inplace, #slideshow .view {
text-align: center;
}

#paragraphView, #paragraphEdit, #markupView, #markupEdit {
font-family: "Times New Roman", serif;
font-size: 14px;
}
#paragraphView, #markupView {
border: 1px solid #fff;
padding: 8px;
width: 400px;
max-width: 400px;
}
#paragraphView:hover, #markupView:hover {
background-color: #ffffcc;
border-color: #ccc;
}
#paragraphEdit, #markupEdit {
width: 315px;
background-color: #ffffcc;
}
#paragraphEdit {
height: 5em;
}
#markupEdit {
height: 15em;
}

#listExamples td {
width: 9em;
margin-right: 20px;
padding: 0px 20px;
vertical-align: top;
}
#listExamples th {
vertical-align: bottom;
font-weight: normal;
font-size: 14px;
padding-top: 20px;
}
#listExamples td.caption {
font-size: 12px;
text-align: center;
}
#listExamples li {
padding: 0px;
height: 20px;
min-height: 1em;
width: 120px;
}
#listExamples li .view {
height: 16px;
vertical-align: middle;
padding: 2px;
}
#list1 li:hover {
background-color: #eee;
}
#listExamples input.inplace {
width: 120px;
max-width: 120px;
}

/* BugFix: Firefox: avoid bottom margin on draggable elements */
#listExamples #list4, #listExamples #list5 { margin-top: -2px; }
#listExamples #list4 li, #listExamples #list5 li { margin-top: 4px; }

#listExamples #list4 li { cursor: default; }
#listExamples #list4 .handle,
#listExamples #list5 .handle {
float: right;
background-color: #ccc;
background-image: url(common/handle.png);
background-repeat: repeat-y;
width: 7px;
height: 20px;
}
#listExamples #list4 li .view {
cursor: text;
}
#listExamples #list4Editors input.inplace, #listExamples #list5 input {
width: 104px;
max-width: 104px;
}
#listExamples #list4Editors>input.inplace, #listExamples #list5>li>input {
width: 111px;
max-width: 111px;
}
#list5 input {
background-color: #eee;
}
.inplace, #list5 input {
margin: 0px;
padding-left: 1px;
}
.handle {
cursor: move;
}
--></style>

<script language="JavaScript" type="text/javascript" src="/site_flash/pruebas/core.js"></script>
<script language="JavaScript" type="text/javascript" src="events.js"></script>
<script language="JavaScript" type="text/javascript" src="css.js"></script>
<script language="JavaScript" type="text/javascript" src="coordinates.js"></script>
<script language="JavaScript" type="text/javascript" src="drag.js"></script>
<script language="JavaScript" type="text/javascript" src="dragsort.js"></script>



<script language="JavaScript" id="aa">
var ESCAPE = 27
var ENTER = 13
var TAB = 9

var coordinates = ToolMan.coordinates()
var dragsort = ToolMan.dragsort()

window.onload = function() {

// TODO: this API sucks
join("paragraph", true)
join("markup", true)
}




//editando
function join(name, isDoubleClick) {
var view = document.getElementById( name + "View")
view.editor = document.getElementById( name + "Edit")

var showEditor = function(event) {
event = fixEvent(event)

var view = this
var editor = view.editor

if (!editor) return true

if (editor.currentView != null) {
editor.blur()
}
editor.currentView = view

var topLeft = coordinates.topLeftOffset(view)
topLeft.reposition(editor)
if (editor.nodeName == 'TEXTAREA') {
editor.style['width'] = view.offsetWidth + "px"
editor.style['height'] = view.offsetHeight + "px"
}
editor.value = view.innerHTML
editor.style['visibility'] = 'visible'
view.style['visibility'] = 'hidden'
editor.focus()
return false
}

if (isDoubleClick) {
view.ondblclick = showEditor
} else {
view.onclick = showEditor
}
//despues de editar
view.editor.onblur = function(event) {
event = fixEvent(event)

var editor = event.target
var view = editor.currentView

if (!editor.abandonChanges) view.innerHTML = editor.value
editor.abandonChanges = false
editor.style['visibility'] = 'hidden'
editor.value = '' // fixes firefox 1.0 bug
view.style['visibility'] = 'visible'
editor.currentView = null

return true
}


// TODO: this method is duplicated elsewhere
function fixEvent(event) {
if (!event) event = window.event
if (event.target) {
if (event.target.nodeType == 3) event.target = event.target.parentNode
} else if (event.srcElement) {
event.target = event.srcElement
}

return event
}
}
  #2 (permalink)  
Antiguo 06/03/2007, 07:32
 
Fecha de Ingreso: marzo-2007
Mensajes: 751
Antigüedad: 17 años, 2 meses
Puntos: 4
Re: alguien sabe por que no funciona

esta es la segunda parte del codigo y es donde indico cual es la linea

var NF=0;
var NC=1;

function A(AF)
{
var ic,name,View,paragraph,edit,ii,ct,tt="<tbody><tabl e id='a' border=1 width='600px' bgcolor='#999999'>";
for(var q=0;q<NF;q++)
{
tt+="<tr>";
for(var w=0;w<NC;w++)
{
ic="F"+q+"_C"+w;
ii="CT_"+ic;


if(!document.getElementById(ii))
{
ct=ic;
}
else
{
ct=document.getElementById(ii).value;
}
tt+="<td id='"+ic+"'>";

-------aqui esta

tt+="<p id='paragraphView'>Editable #1:texto gragado</p><textarea height='50' width='50' id='paragraphEdit'class='inplace'tabindex='1'></textarea></td>";
}

-------------.
tt+="</tr>";
}
if(!AF)
{
if(NF<=0) {document.getElementById('ca').innerHTML="Tabla vacía.";return AF;}
tt+="</tr></tbody></table>";
document.getElementById('ca').innerHTML=tt;
return AF;
}
tt+="<tr>";
for(var q=0;q<NC;q++)
{
ic="F"+NF+"_C"+q;
ii="CT_"+ic;
tt+="<td id='"+"'></td>";
}
tt+="</tr></tbody></table>";
document.getElementById('ca').innerHTML=tt;
NF++;
}
function B()
{
if(NF>0)
{
NF--;
A(false);
}
}
function C()
{
NC++;
A(false);
}

function Cc()
{
NC++;
NC++;
A(false);
}

function D()
{
if(NC>0)
{
NC--;
A(false);
}
}


</script>




</head><body>



<input type="button" name="af" value="Agregar fila" onClick="A(true);">


<input type="button" name="qf" value="Quitar fila" onClick="B();">
<input type="button" name="ac" value="Añadir columna" onClick="C();">
<input type="button" name="cc" value="Añadir 2 columna" onClick="Cc();">
<input type="button" name="qc" value="Quitar columna" onClick="D();">
<br><br><div id="ca">Tabla vacía.</div>


<!--<table id='a' width='600px' bgcolor='#999999'>
<tr><td>

<p id="paragraphView">Editable #1: Double-click anywhere in this paragraph to edit its content. Press TAB or click outside the edit area to finish. Press ESCAPE to cancel.</p>
<textarea id="paragraphEdit" class="inplace" tabindex="1"></textarea>
</td></tr></table>-->

</body></html>



es una tabla la cual se pueden añadir filas y columnas y dentro se puede editar un text area

espero puedan ayudarmen
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:46.