Thanks for your reply, i know It's a little tough to track, i have
more difficult because i'm not expert on js/jquery.
I do the first thing you tell me: $('tr.child-'+this.id).toggle();
This is a better way, but the i still have the problem with IE 8.
Then i try 2nd modify and the code run correctly on IE 8. I think is a
bug of toggle() function or not?
For now i rewrite the code to hide/show using hide(), show() function:
<script>
$(function() {
$('td.title')
.click(function(){
if
($('div.visualizza'+this.id).css('background-image').search(/
frecciadown.png/)!=-1 ) {
$('div.visualizza'+this.id).css
('background-image', "url(default.asp_files/images/frecciaup.png)");
$('div.visualizza'+this.id).attr("title","Nascondi i contenuti");
$('tr[alt^=bottom'+this.id+']').show();
$('tr.child-'+this.id).show();
} else {
$('div.visualizza'+this.id).css
('background-image', "url(default.asp_files/images/frecciadown.png)");
$('div.visualizza'+this.id).attr("title","Mostra i contenuti");
$('tr[alt^=bottom'+this.id+']').hide();
$('tr.child-'+this.id).hide();
}
});
$('div.[class^=visualizza]').css
("cursor","pointer");
$('div.[class^=visualizza]').css("background-image",
"url
(default.asp_files/images/frecciadown.png)");
$('div.[class^=visualizza]').attr("title","Mostra i
contenuti");
$('tr[class^=child-]').hide().children('td');
$('tr[alt^=bottomriga]').hide();
});
</script>
The test page with this mod is still here: http://www.pubblimedia.com/Test/
Let me know if there are some news about this problem with toggle()
function and when i can remove the page from server.
Thanks for all.
On 28 Lug, 19:11, Fontzter <[email protected]> wrote:
> Hi,
>
> It's still a little tough to track what is going on. Here are a few
> things to try:
>
> You can just get the rows that you want to show without referencing
> the siblings. I think this is the line of code that may be causing
> your troubles:
>
> $('tr').siblings('.child-'+this.id).toggle();
>
> $('tr) is saying give me all TRs, then it is asking for siblings of
> all those TRs that have a class of 'child-XXX'. It would be much
> bettter to just get the trs with that class directly like this:
>
> $('tr.child-'+this.id).toggle();
>
> I think making this change might fix the issue. If not, try doing
> a .show() instead of .toggle() to test if there are any issue there.
>
> Let me know if that fixes it.
>
> Hth,
>
> Dave
>
> On Jul 28, 12:17 pm, Mondo Libero <[email protected]> wrote:
>
> > Thanks for your help. The site you give me is worderful, i've never
> > seen it before!
>
> > I try to publish the html output on this link, adding the absolute
> > reference to my server, but it do not run.
>
> > I save the html source and publish it here for
> > testing:http://www.pubblimedia.com/Test/
>
> > - this.id in my qyery code is rigaN, where N is the number of
> > category, unique in database.
>
> > Thanks for your help, have a nice day!
>
> > On 28 Lug, 15:53, Fontzter <[email protected]> wrote:
>
> > > Hi,
>
> > > There is a lot going on in your pasted code. Your code seems to set
> > > elements to child-riga... and you are just looking for child-... in
> > > your jquery code. I could be wrong though. You will need to provide
> > > a simpler example (just the html produced by your server-side code).
> > > Putting it onhttp://jsbin.comwouldbea big help.
>
> > > Dave
>
> > > On Jul 27, 3:44 pm, Vincenzo Ferme <[email protected]> wrote:
>
> > > > Hi, i’m Vincenzo, a web developer from Italy. I use your ajax code
> > > > following the guide ad the
> > > > example:http://www.javascripttoolbox.com/jquery/?doctype=strict
> > > > . I have some question about my work with your code, if can answer me.
>
> > > > Here the question:
>
> > > > The problem is that my code do not run on explorer 8, when I click on
> > > > td where I apply the function, child td are not showed.
>
> > > > Here the code:
>
> > > > <%
> > > > dim sqlcat, idcat, nome, pos, citta, indirizzo, telefono, cellulare,
> > > > sito, mail, persona, arrivare, descrizione, tipologia, mappa,
> > > > numcatpres
>
> > > > '----------------------------- ELENCO RISORSE
> > > > -----------------------------'
> > > > sub listRisorse()
> > > > %>
> > > > <br />
> > > > <h1>GESTIONE CATEGORIE/RISORSE</h1>
> > > > <div id="notice"><%= request("notice") %></div>
> > > > <p class="center">
> > > > <input type="button" value="Inserisci Nuova Categoria"
> > > > onclick="window.location.href='<%= url %>?action=newcat'" />
> > > > <%
> > > > 'Conto le categorie perchè il pulsante per aggiungere
> > > > contenuti si
> > > > deve attivare solo in caso vi siano categorie
> > > > sqlcat="SELECT COUNT(*) AS numcatpres FROM Categorie"
> > > > dbOpen(sqlcat)
> > > > numcatpres=objRS("numcatpres")
> > > > dbClose(true)
> > > > if numcatpres<>0 then
> > > > %>
> > > >
> > > > <input type="button" value="Inserisci Nuovo Contenuto"
> > > > onclick="window.location.href='<%= url %>?action=new'" />
> > > > <% end if %>
> > > > <!--Precarico le immagini necessarie-->
> > > > <img src="../../images/frecciadown.png" style="display:none;
> > > > visibility:hidden" />
> > > > <img src="../../images/frecciaup.png" style="display:none;
> > > > visibility:hidden" />
> > > > <br /><br />
> > > > </p>
> > > > <%
>
> > > > 'Seleziono le eventuali categorie presenti
> > > > sqlcat="SELECT C.ID AS idcat, C.nome AS nome, C.pos AS pos FROM
> > > > Categorie C ORDER BY C.pos"
>
> > > > dbOpen(sqlcat)
>
> > > > if not objRS.EOF then
> > > > %>
> > > > <script>
> > > > $(function() {
> > > > $('td.title')
> > > > .click(function(){
> > > > $('tr').siblings('.child-'+this.id).toggle();
>
> > > > if
> > > > ($('div.visualizza'+this.id).css('background-image').search(/
> > > > frecciadown.png/)!=-1 ) {
> > > >
> > > > $('div.visualizza'+this.id).css('background-image', "url
> > > > (/images/frecciaup.png)");
> > > >
> > > > $('div.visualizza'+this.id).attr("title","Nascondi i contenuti");
> > > >
> > > > $('tr[alt^=bottom'+this.id+']').toggle();
> > > > } else {
> > > >
> > > > $('div.visualizza'+this.id).css('background-image', "url
> > > > (/images/frecciadown.png)");
> > > >
> > > > $('div.visualizza'+this.id).attr("title","Mostra i contenuti");
> > > >
> > > > $('tr[alt^=bottom'+this.id+']').toggle();
> > > > }
>
> > > > });
> > > > $('div.[class^=visualizza]').css("cursor","pointer");
> > > >
> > > > $('div.[class^=visualizza]').css("background-image", "url(/images/
> > > > frecciadown.png)");
> > > > $('div.[class^=visualizza]').attr("title","Mostra i
> > > > contenuti");
> > > > $('tr[class^=child-]').hide().children('td');
> > > > $('tr[alt^=bottomriga]').hide();
> > > > <% if request("cat")<> "" then %>
> > > > $('tr[class^=child-riga<%
> > > > =request("cat")%>]').toggle();
> > > > $('tr[alt^=bottomriga<%
> > > > =request("cat")%>]').toggle()
> > > > $('div.visualizzariga'+<%
> > > > =request("cat")%>).attr("title","Nascondi
> > > > i contenuti");
> > > > $('div.visualizzariga'+<%
> > > > =request("cat")%>).css('background-
> > > > image', "url(/images/frecciaup.png)");
> > > > <% end if %>
> > > > });
> > > > </script>
> > > > <%
> > > > dim counter, titlecat, classtag
> > > > counter=0
> > > > titlecat=0
>
> > > > DO WHILE NOT objRS.EOF
>
> > > > 'Seleziono gli eventuali contenuti associati alla
> > > > categoria
> > > > sql="SELECT nome FROM Risorse WHERE IDcat=" &
> > > > objRS("idcat")
> > > > dbOpen2(sql)
> > > > if not objRS2.EOF then
> > > > classtag="title"
> > > > else
> > > > classtag="titleno"
> > > > end if
> > > > titlecat=objRS("idcat")
> > > > %>
> > > > <table id="tabellaRisorse">
>
> > > > <tbody>
> > > > <tr>
> > > > <td colspan="4">
> > > > <table width="100%" style="height:21px;">
> > > > <tr>
> > > > <td class="<%=classtag%>" id="riga<% =titlecat %>"
> > > > style="width: 20px; height:21px;">
> > > > <div style="float:left; width:20px; height: 21px; margin-
> > > > right: 5px; margin-top: 2px;" class="visualizzariga<% =titlecat
> > > > %>"> </div></td>
> > > > <td>
> > > > <div style="left: 50%; float: left; margin-top:2px;">
> > > > <b id="<% =objRS("idcat")%>" class="edit_area"><%= UCase
> > > > (objRS("nome")) %></b>
> > > > </div>
> > > > </td>
> > > > <td width="155" style="text-align:left;padding-bottom:
> > > > 2px;">
> > > > <b>Pos:</b> <b id="<% =objRS("idcat")%>"
> > > > class="edit_area_pos"><%= objRS("pos") %></b>
> > > > </td>
> > > > <td width="30" style="text-
> > > > align:left;background:#006600;color:#FFF;padding-bottom: 5px;">
> > > > <div style="position: relative; float:right; text-
> > > > align:left;"><a href="<%= url %>?action=delCat&cat=<%= objRS
> > > > ("idcat") %>&nome=<%= Server.URLEncode(objRS("nome")) %>"
> > > > style="color:#FFF;">Elimina</a></div>
> > > > </td>
> > > > </tr>
> > > > </table>
> > > > </td>
> > > > </tr>
> > > > <%
>
> > > > if objRS2.EOF then
> > > > %>
>
> > > > <script>
> > > > $(function() {
> > > > /*Visualizzo il corretto messaggio sul pulsante di
> > > > visualizzazione dei contenuti*/
> > > > $('div.visualizzariga'+<% =objRS("idcat")%>).attr
> > > > ("title","Nessun contenuto presente");
> > > > $('div.visualizzariga'+<%
> > > > =objRS("idcat")%>).css
> > > > ("cursor","default");
> > > > });
> > > > </script>
>
> > > > <%
> > > > end if
> > > > dbClose2(true)
> > > > 'Seleziono gli eventuali contenuti associati alla
> > > > categoria
> > > > sql="SELECT * FROM Risorse WHERE IDcat=" &
> > > > objRS("idcat")
> > > > dbOpen2(sql)
> > > >
>
> ...
>
> leggi tutto
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---