我想要每个都有不同的画廊画廊的 onclick 字幕(不是弹出式风格)。我在单独的 html 页面中有画廊画廊,现在我想在我的展示页面上进行 ajax 调用,以便在单击字幕时调出画廊。
我哪里错了?
到目前为止,这是我的 php 页面的代码:
<?
$main_content .= '
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script src="galleria/galleria-1.2.9.min.js"></script>
<style>
#galleria{ width: 700px; height: 400px; background: #000; }
</style>
<script type="text/javascript">
$(document).ready(function() {
$("#agricultural").click(function() {
changeProduct($(this), $(this));
$("#galleria").load("AgriculturalSlideshow.html");
});
$("#commercial").click(function() {
changeProduct($(this), $(this));
$("#galleria").load("CommercialSlideshow.html");
});
$("#community").click(function() {
changeProduct($(this), $(this));
$("#galleria").load("communityslideshow.html");
});
$("#industrial").click(function() {
changeProduct($(this), $(this));
$("#galleria").load("industrialslideshow.html");
});
$("#recreational").click(function() {
changeProduct($(this), $(this));
$("#galleria").load("recreationalslideshow.html");
});
$("#underconstruction").click(function() {
changeProduct($(this), $(this));
$("#galleria").load("underconstructionslideshow.html");
});
function changeProduct(menu, obj){
$(".productMenu").css({"color":"#000000"});
$(".prodContent").hide();
$(menu).css({"color":"#a50000"});
$(obj).fadeIn();
}
});
</script>
<div style="padding-top:0px; padding-bottom:50px;">
<div class="pageHeader">
SHOWCASE
</div>
<div class="content">
<div style="padding:20px 0px 20px 0px;">
<span class="productMenu" id="agricultural" style="cursor:pointer; padding-right:20px; color:#a50000">AGRICULTURAL</span>
<span class="productMenu" id="commercial" style="cursor:pointer; padding-right:20px;">COMMERCIAL</span>
<span class="productMenu" id="community" style="cursor:pointer; padding-right:20px;">COMMUNITY</span>
<span class="productMenu" id="industrial" style="cursor:pointer; padding-right:20px;">INDUSTRIAL</span>
<span class="productMenu" id="recreational" style="cursor:pointer; padding-right:20px;">RECREATIONAL</span>
<span class="productMenu" id="underconstruction" style="cursor:pointer; padding-right:20px;">UNDERCONSTRUCTION</span>
</div>
<div id="galleria">
</div>
<script>
Galleria.loadTheme("galleria/themes/classic/galleria.classic.min.js");
Galleria.run("#galleria");
</script>
<div style="clear:both; text-align:justify; text-align-last:justify;padding-top:50px;">
AGRICULTURAL | COMMERCIAL | RESIDENTIAL & GARAGES | GOVERNMENT | INDUSTRIAL | INSTITUTIONAL | RECREATIONAL
</div>
<div style="clear:both"></div>
</div>';
?>