Fish Eye Menu Support Product Page

This topic was archived

Dynamic Images...

Shared 08 Jun 2007 19:20:25
1
likes this idea
08 Jun 2007 19:20:25 Bobby Edgar posted:
It would be cool if you could make the images come from a DB of a recordset.

Replies

Replied 13 Jun 2007 18:17:43
13 Jun 2007 18:17:43 dominique dval replied:
I think it too.
Replied 14 Jun 2007 10:50:43
14 Jun 2007 10:50:43 Georgi Kralev replied:
Hi All,

Fish Eye Menu code could be easily modified to display the images from Database recordset.
And this could be accomplished with already available Sever Behaviors in Dreamweaver.
Therefore, at this point I do not believe that this feature is quite necessary.

Check the following sample code:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
&lt;%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%&gt;
&lt;!--#include file="Connections/cnnTest_DB.asp" --&gt;
&lt;%
var rsImages__MMColParam = "1";
if (String(Request.QueryString("id") != "undefined" &&
String(Request.QueryString("id") != "" {
rsImages__MMColParam = String(Request.QueryString("id");
}
%&gt;
&lt;%
var rsImages_cmd = Server.CreateObject ("ADODB.Command";
rsImages_cmd.ActiveConnection = MM_cnnTest_DB_STRING;
rsImages_cmd.CommandText = "SELECT * FROM dbo.Images WHERE id &gt; ?";
rsImages_cmd.Prepared = true;
rsImages_cmd.Parameters.Append(rsImages_cmd.CreateParameter("param1", 5, 1, -1, rsImages__MMColParam)); // adDouble

var rsImages = rsImages_cmd.Execute();
var rsImages_numRows = 0;
%&gt;
&lt;%
var Repeat1__numRows = 5;
var Repeat1__index = 0;
rsImages_numRows += Repeat1__numRows;
%&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;sample_FEM&lt;/title&gt;
&lt;script src="ScriptLibrary/jquery-latest.pack.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="ScriptLibrary/jquery.dimensions.pack.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="ScriptLibrary/DMXFishEye-min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;link href="styles/fisheye.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;% var LeftPosCounter = 0; %&gt;
&lt;div id="fishEye1" class="fisheye"&gt;
&lt;div style="left: 440px" class="fisheyeContainter"&gt;
&lt;% while ((Repeat1__numRows-- != 0) && (!rsImages.EOF)) { %&gt;
&lt;a style="width: 40px; left: &lt;%=LeftPosCounter%&gt;px;" href="" class="fisheyeItem"&gt;&lt;img src="Images/&lt;%=(rsImages.Fields.Item("imgName".Value)%&gt;" width="40" /&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;
&lt;%
LeftPosCounter += 40;
Repeat1__index++;
rsImages.MoveNext();
}
%&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
// &lt;![CDATA[
$(document).ready(
function()
{
$("#fishEye1".dmxFishEye(
{
itemWidth: 40,
maxWidth: 30,
smoothness: 'high',
items: 'a',
textItems: 'span',
container: '.fisheyeContainter'
}
);
}
);
// ]]&gt;
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsImages.Close();
%&gt; <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com

Reply to this topic