| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
images rows
hi there, i have a asp page which loads up several pictures. the problem being is that they are being displayed in a vetical list.
how can i get to display the images in horizontal rows of say 3? any help would be great |
|
#2
|
||||
|
||||
|
post your code for the displaying of the images ...
__________________
Come JOIN the party!!! Quote of the Month: Sacrifice (Temple): All we ask here is that you give us your heart. Questions to Ponder: If the #2 pencil is the most popular, why is it still #2? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright© 2008 sbenj69 |
|
#3
|
|||
|
|||
|
Code:
<% IF prodRS( "product_picture" ) <> "?????" THEN %> <IMG SRC="<%=prodRS( "product_picture" )%>" <% END IF %> |
|
#4
|
||||
|
||||
|
could you post everything from the 'do while' to the 'loop' at least .... it will be easier to show you how to display 3 across before moving to the next line.
|
|
#5
|
|||
|
|||
|
heres the full script
Code:
<!-- #include file = "Default.asp" --> <% 'Get the Current Page pg = TRIM( Request( "pg" )) if pg = "" THEN pg = 1 'Open Recordset Set prodRS = Server.CreateObject( "ADODB.recordset" ) prodRS.ActiveConnection = Conn prodRS.CursorType = 3 'adOpenStatic prodRS.PageSize = 5 sqlString = "SELECT product_id, product_picture, product_name, product_briefDesc " &_ "FROM Products WHERE product_category= 'winter' " &_ "AND product_status='active' " &_ "ORDER BY product_name " prodRS.Open sqlString prodRS.AbsolutePage = pg %> <div class="product"> <% WHILE NOT prodRS.EOF and rowCount < prodRS.PageSize rowCount = rowCount + 1 %> <div class="product_border"> <% IF prodRS( "product_picture" ) <> "?????" THEN %> <IMG SRC="<%=prodRS( "product_picture" )%>" <% END IF %> <br> </div> <a href="product.asp?pid=<%=prodRS( "product_id" )%>"> <%=prodRS( "product_name" )%></a> <br><a href="product.asp?pid=<%=prodRS( "product_id" )%>"> get more information</a> <% prodRS.MoveNext WEND %> <% IF prodRS.PageCount > 1 THEN %> <font color="darkgreen"> <b>Go to page: </b> <% FOR i = 1 to prodRS.PageCount IF i <> cINT(pg) THEN %> <a href="productlist.asp?=<%=Server.URLEncode( cat )%>&pg=<%=i%>"> <%=i%> <% ELSE %> <%=i%> <% END IF %> <% NEXT %> </div> <% END IF %> |
|
#6
|
||||
|
||||
|
have such code:
Code:
<%
Const IMAGES_PER_ROW=3
rowCount=0
WHILE NOT prodRS.EOF and rowCount < prodRS.PageSize
If (rowCount Mod IMAGES_PER_ROW)=0 Then
If rowCount>0 Then Response.Write("</div>")
Response.Write("<div class=""product_border"">")
End If
Response.Write("<a href=""product.asp?pid="&prodRS( "product_id" )&""" title=""get more information"">")
IF prodRS( "product_picture" ) <> "?????" THEN
Response.Write("<img src="""&prodRS( "product_picture" )&""" alt="""&prodRS( "product_name" )&""" />")
Else
Response.Write(prodRS( "product_name" ))
End If
Response.Write("</a>")
rowCount = rowCount + 1
prodRS.MoveNext
WEND
%>
consider creating default image, it would be much more nice for the user to see... |
|
#7
|
|||
|
|||
|
thanks shadow wizard.
one problem - neither the product name or "get more information" links are appearing any ideas why? |
|
#8
|
||||
|
||||
|
Quote:
used as link and when clicked will take you to the details page. that's what looked better in my opinion, feel free to change the html to whatever design you like. |
|
#9
|
|||
|
|||
|
ok. cud you point us out on how to display the "getmore information" and product name link from the code
Code:
<%
Const IMAGES_PER_ROW=3
rowCount=0
WHILE NOT prodRS.EOF and rowCount < prodRS.PageSize
If (rowCount Mod IMAGES_PER_ROW)=0 Then
If rowCount>0 Then Response.Write("</div>")
Response.Write("<div class=""product_border"">")
End If
Response.Write("<a href=""product.asp?pid="&prodRS( "product_id" )&""" title=""get more information"">")
IF prodRS( "product_picture" ) <> "?????" THEN
Response.Write("<img src="""&prodRS( "product_picture" )&""" alt="""&prodRS( "product_name" )&""" />")
Else
Response.Write(prodRS( "product_name" ))
End If
Response.Write("</a>")
rowCount = rowCount + 1
prodRS.MoveNext
WEND
%>
|
|
#10
|
||||
|
||||
|
you can add the text beside the image:
Code:
Response.Write("<img src="""&prodRS( "product_picture" )&""" alt="""&prodRS( "product_name" )&""" />"&prodRS( "product_name" ))
|
|
#11
|
|||
|
|||
|
is it possbile to place the text below the image and a space between each record
|
|
#12
|
||||
|
||||