gpt4 book ai didi

php - float 网格样式中的图像翻转

转载 作者:太空宇宙 更新时间:2023-11-03 18:59:11 24 4
gpt4 key购买 nike

我为小部件区域中的链接做了一个简单的翻转(不确定如何做那部分,目前不重要)我正在做这个的网站是 www.avuedesigns.com/new 目前在横幅内容框下方的左侧,我希望在那个区域就是这个。

这就是我想出的http://jsfiddle.net/paDmg/368/

所以我的问题是,这会在那个领域起作用(执行方面),还是尝试不同的方式?

此外,将其制作成 wordpress 的小部件以将其放在该区域是否容易?我们的 php 人员正在休假 2 周,并试图独自完成该元素。我确信我能弄清楚,我只需要指出方法的方向即可。

再次翻滚:http://jsfiddle.net/paDmg/368/

也复制粘贴到这里。

CSS

ul#hover-grid {
padding: 0;
list-style: none;
margin: 0px auto 0;
margin-top: 0;
width: 220px;
}

#hover-grid li {
float: left;
padding: 2;
margin: 0 1px 1px 1px;
}

#hover-grid .indiv-cell {
width: 65px;
height: 65px;
}

HTML

 <ul id="hover-grid">


<li class="indiv-cell"><a href="#"><img data-replacementimg="http://avuedesigns.com/new/wp-content/uploads/2012/09/1.jpg" src="http://avuedesigns.com/new/wp-content/uploads/2012/09/6.jpg"></a></li>

<li class="indiv-cell"><a href="#"><img data-replacementimg="http://avuedesigns.com/new/wp-content/uploads/2012/09/2.jpg" src="http://avuedesigns.com/new/wp-content/uploads/2012/09/6.jpg"></a></li>

<li class="indiv-cell"><a href="#"><img data-replacementimg="http://avuedesigns.com/new/wp-content/uploads/2012/09/3.jpg" src="http://avuedesigns.com/new/wp-content/uploads/2012/09/6.jpg"></a></li>

<li class="indiv-cell"><a href="#"><img data- replacementimg="http://avuedesigns.com/new/wp-content/uploads/2012/09/4.jpg" src="http://avuedesigns.com/new/wp-content/uploads/2012/09/6.jpg"></a></li>

<li class="indiv-cell"><a href="#"><img data-replacementimg="http://avuedesigns.com/new/wp-content/uploads/2012/09/1.jpg" src="http://avuedesigns.com/new/wp-content/uploads/2012/09/6.jpg"></a></li>

<li class="indiv-cell"><a href="#"><img data-replacementimg="http://avuedesigns.com/new/wp-content/uploads/2012/09/2.jpg" src="http://avuedesigns.com/new/wp-content/uploads/2012/09/6.jpg"></a></li>


</ul>​

Javascript

$('#hover-grid .indiv-cell').hover(function() {

//set variables to current cell attributes
var cellHeader = $(this).attr('data-hoverheader');
var cellText = $(this).attr('data-hovertext');
var replacementImg = $(this).find('a img').attr('data-replacementimg');
var oringinalImg = $(this).find('a img').attr('src');

//save original image to data variable
$(this).data('origImg', oringinalImg);



//add remove classes
$('#hover-grid .indiv-cell').removeClass('newClass');
$(this).addClass('newClass', 1000);
$(this).find('a img').hide().attr('src', replacementImg).fadeIn(300);
$('.master-cell h1').hide().text(cellHeader).fadeIn(300);
$('.master-cell p').hide().text(cellText).fadeIn(300);


//return false;
}, function() {
$(this).find('a img').hide().attr('src', $(this).data('origImg')).fadeIn(10);
});​

最佳答案

我相信你想把你的 html 变成一个动态导航菜单,对吧? Wordpress 法典 has settings for this where you can structure the menu to match your html .

我认为像这样的一些设置可能会让你入门

<?php $defaults = array(
'theme_location' => 'custom-menu',
'container' => 'div',
'menu_class' => 'indiv-cell',
'echo' => true,
'fallback_cb' => 'wp_page_menu',
'items_wrap' => '<ul id="hover-grid">%2$s</ul>',
); ?>

<?php wp_nav_menu( $defaults ); ?>

关于php - float 网格样式中的图像翻转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12627416/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com