Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di Ashry
    Registrato dal
    Jul 2002
    Messaggi
    586

    chiudere ed aprire un div in base al cambio di "categoria"

    salve a tutti sto ceercando di adattare la grafica di un blog alle mie esigenze ma ho un piccolo problema con la gestione delle categorie.

    avrei bisogno di dividerle in colonne il mio problema è che non riesco ad aprire e chiudere i div che contengono gli articoli in base al cabio della categoria

    vi posto parte del codice

    intArticlesLoop = 0
    dim categoria, categoria_old
    'loop through current articles
    do until intArticlesLoop = intArticlesCount
    'assegno a categoria il valore contenuto nel db
    categoria = SQL_decode(arrArticlesData(8, intArticlesLoop))
    'draw article container
    if intCategory = 0 then
    response.write("<div id='article'>")
    else
    response.write("<div class='article'>")
    end if
    'display category
    if ((categoria <> categoria_old) and (categoria_old = "")) then
    response.write("<div class='article_cat'>"&SQL_decode(arrArticlesData(8 , intArticlesLoop))&"</div>")
    end if
    if ((categoria <> categoria_old) and (categoria_old <> "")) then

    response.write("<div class='article_cat'>"&SQL_decode(arrArticlesData(8 , intArticlesLoop))&"</div>")
    end if

    'display article title

    'display article details
    'close category
    categoria_old = categoria

    response.write("</div>")
    'increment counter
    intArticlesLoop = intArticlesLoop + 1

    loop


    potreste aiutarmi?
    grazie

  2. #2
    Utente di HTML.it L'avatar di Ashry
    Registrato dal
    Jul 2002
    Messaggi
    586
    Così sembra funzionare
    'initialise counter
    intArticlesLoop = 0
    dim categoria, categoria_old
    'loop through current articles
    do until intArticlesLoop = intArticlesCount
    'assegno a categoria il valore contenuto nel db
    categoria = SQL_decode(arrArticlesData(8, intArticlesLoop))
    'draw article container
    'display category
    if ((categoria <> categoria_old) and (categoria_old = "")) then
    if intCategory = 0 then
    response.write("<div id='article'>")
    else
    response.write("<div class='article'>")
    end if
    response.write("<div class='article_cat'>"&SQL_decode(arrArticlesData(8 , intArticlesLoop))&"</div>")
    end if

    if ((categoria <> categoria_old) and (categoria_old <> "")) then
    if intCategory = 0 then
    response.write("</div><div id='article'>")
    else
    response.write("</div><div class='article'>")
    end if
    response.write("<div class='article_cat'>"&SQL_decode(arrArticlesData(8 , intArticlesLoop))&"</div>")
    end if

    'display article title

    'display article details

    'close category
    categoria_old = categoria

    'response.write("</div>")
    'increment counter
    intArticlesLoop = intArticlesLoop + 1

    loop

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.