Reputation: 1
I'm pretty new to programming, and i'm writing a pretty simple website for an outlet, with 4 pages: home, beauty, wellbeing, contacts.
This website will be a showroom for this outlet's articles, which will be shown in the two section of the website, depending on their area of interest.
The contractor wanted of course to be able to upload articles on his own when he wanted, so I build a simple application in php, with a login, an administration page, where he could just write Title, price, description and upload an image for the article.
All is all right, The php program is ok, uploads go smooth, the page with the articles are automatically generated by the php program, which takes the data from the mysql database, via a while cycle.
The last problem which I cannot solve, is a Slider in the homepage. The same identical in the article's pages, have to be shown in a in home page, but not one under the other, instead they must scroll in a div, and of course the article's divs are generated by the php program.
Now, i'm not all that great in javascript, so I don't know if I'm doing it the right way, or if something's wrong with the jquery plugin I use.
The code is this:
In the header:
<script src="js/jquery.jshowoff.min.js" type="text/javascript"></script>
And in the Body:
<div id="vetrina">
<?php
include "database.php";
$connection = Database::getConnection();
$query = ("SELECT * FROM `articoli` WHERE (`importante_art` = 'si') ORDER BY `id_art` DESC");
$ris = $connection->query($query) or die (mysqli_error())
$row_cnt = $ris->num_rows;
if(($row_cnt) > 0){
$row = "";
while ($row = mysqli_fetch_array($ris)){
$id_post = $row['id_art'];
$titolo_post = stripslashes($row['titolo_art']);
$testo_post = stripslashes($row['descrizione_art']);
$immagine_post = $row['immagine_art'];
$prezzo_post = $row['prezzo_art'];
echo '<div class="evidenziato">';
echo '<h4 class="titolo_evidenziato">'.$titolo_post.'</h4>';
echo '<p class="prezzo">'.$prezzo_post.'</p>';
echo '<img class="img_evidenziato" src='.$immagine_post.'></img>';
echo '<p class="descrizione_articolo">' . $testo_post . '</p>';
echo '</div>';
}
}else{
echo "Right now there are no articles to display";
}
?>
</div>
<script type="text/javascript">
$(document).ready(function(){ $('#vetrina').jshowoff(); });
</script>
I used the showoff plugin, that should do what i want.
http://ekallevig.com/jshowoff/
I don't know what I'm doing wrong... :\ I even tried to do the slideshow without the php program, by simpli typing in the articles, but nothing.
I tried 5 different plugins.
Maybe it's just that i'm doing something wrong at the base.
Anyway, my divs come out all right, i see that they are all there, but they just wont slide...
Upvotes: 0
Views: 911
Reputation: 1260
as mentioned at http://ekallevig.com/jshowoff/ site
for jshowoff required two files.
1). the jQuery Core JavaScript Library (1.3+)
2). jquery.jshowoff.min.js
Did you used both files?.
Upvotes: 1