<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Edtor CSS con Jquery]]></title><description><![CDATA[<p dir="auto">Salve,<br />
sto imparando ad applicare Jquery e sto provando a costruire un web editor di CSS, come <a href="http://templatr.cc" rel="nofollow ugc">templatr.cc</a> oppure lo stesso Theme Roller delle Jquery-UI (ovviamente con un'aspettativa diversa).</p>
<p dir="auto">Potete vedere (e scaricare) il progetto su:</p>
<p dir="auto"><a href="http://tt4fn.netsons.org/fonte" rel="nofollow ugc">tt4fn.netsons.org/fonte</a></p>
<p dir="auto">Ora, l'editor funziona così, con il tasto "Show" si mostrano le varie porzioni del css evidenziate da fascette bianche, le fascette sono orizzontali oppure verticali, come potete vedere non riesco a far si che le fascette verticali siano della stessa altezza del blocco (<a href="/hashtags/id">#id</a>) che vanno ad evidenziare.</p>
<p dir="auto">Il codice incriminato nel JS che non funziona è:</p>
<pre><code>       $("div").attr("id", function () {
          return $(this).attr("id");
        })
        .each(function () {

        var sph = $(this).height();
        var spw = $(this).width();

        $("span.dividv").css({position:'absolute', display: 'block' , zIndex:'10'});
        
//Doesn't work, seems that 'sph' and 'spw' are not valid for CSS properties
        //$("span.dividv").height(sph);
        //$("span.divid").width(spw);
//end
//so I need to use a percentage, doesn't render as I want
        $("span.dividv").css({height:'25%'});


        $("span.hid", this).html('&lt;a title="click on white bar to edit ' + this.id + '" class="group"&gt;&lt;img src="images/star.png" alt="' + this.id +'" /&gt;&lt;/a&gt;');
        });
</code></pre>
<p dir="auto">Se passo la variabile 'sph' alla stringa html il valore viene visualizzato, ma se la passo alla funzione height() per impostarla nel CSS il valore non viene preso.</p>
<p dir="auto">Qualcuno sa come aiutarmi?</p>
<p dir="auto">Alfredo</p>
]]></description><link>https://dev.connect.gt/topic/109852/edtor-css-con-jquery</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 03:08:25 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/109852.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 Sep 2009 18:47:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Edtor CSS con Jquery on Wed, 09 Sep 2009 11:31:20 GMT]]></title><description><![CDATA[<p dir="auto">Grazie,<br />
ho provato ma non funziona.</p>
<p dir="auto">tra l'altro leggendo il manuale di jquery alla funct height() :</p>
<blockquote>
<p dir="auto">If no explicit unit was specified (like 'em' or '%') then "px" is concatenated to the value.</p>
</blockquote>
<p dir="auto">La cosa che non capisco è perchè se passo il valore di 'sph' nella stringa in html esso viene stampato, basta modificare questa stringa così:</p>
<pre><code>$("span.hid", this).html('&lt;a title="click on white bar to edit ' + this.id + '" class="group"&gt;&lt;img src="images/star.png" alt="' + this.id +'" /&gt;'+sph+'&lt;/a&gt;');
        });
</code></pre>
<p dir="auto">NB 'sph' nel tag del link.</p>
<p dir="auto">Mentre se la passo come parametro per height ... il nulla</p>
]]></description><link>https://dev.connect.gt/post/856012</link><guid isPermaLink="true">https://dev.connect.gt/post/856012</guid><dc:creator><![CDATA[orazio]]></dc:creator><pubDate>Wed, 09 Sep 2009 11:31:20 GMT</pubDate></item><item><title><![CDATA[Reply to Edtor CSS con Jquery on Wed, 09 Sep 2009 06:54:42 GMT]]></title><description><![CDATA[<p dir="auto">Ciao orazio,<br />
prova ad aggiungere alla variabile la stringa 'px'.</p>
<p dir="auto">Es:<br />
var height = variabile + 'px';</p>
<p dir="auto">Ciao</p>
]]></description><link>https://dev.connect.gt/post/855985</link><guid isPermaLink="true">https://dev.connect.gt/post/855985</guid><dc:creator><![CDATA[mirkoagrati]]></dc:creator><pubDate>Wed, 09 Sep 2009 06:54:42 GMT</pubDate></item></channel></rss>