Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用WordPress提要的jQuery迭代_Php_Jquery_Wordpress_Loops - Fatal编程技术网

Php 使用WordPress提要的jQuery迭代

Php 使用WordPress提要的jQuery迭代,php,jquery,wordpress,loops,Php,Jquery,Wordpress,Loops,我正在使用WordPress类别提要和jQuery构建一个工作公文包,以便在您悬停在公文包示例上时显示一些效果。我想使用jQuery和WordPress提要进行迭代,这样效果对我的每个投资组合示例都有效。。。我已经成功地为我的投资组合中的第一个例子做到了这一点,但是让它在每个投资组合的例子中工作被证明是具有挑战性的。我知道每个投资组合示例都需要一个唯一的标识符,但我不知道如何将其应用于每个示例。请看下面的代码谢谢你的帮助 JS: PHP: 使用类选择器 $('.className') $

我正在使用WordPress类别提要和jQuery构建一个工作公文包,以便在您悬停在公文包示例上时显示一些效果。我想使用jQuery和WordPress提要进行迭代,这样效果对我的每个投资组合示例都有效。。。我已经成功地为我的投资组合中的第一个例子做到了这一点,但是让它在每个投资组合的例子中工作被证明是具有挑战性的。我知道每个投资组合示例都需要一个唯一的标识符,但我不知道如何将其应用于每个示例。请看下面的代码谢谢你的帮助

JS:

PHP:



使用类选择器

$('.className') 
$('div') 
或节点选择器

$('.className') 
$('div') 
或者两者都有

$('div.className')
然后在悬停处理程序中,使用

$(本)

e、 g

$(document).ready(function() {
  $('div.recentWork').hover( 
    function(){ 
      $(this).find('.imagio').fadeOut(); 
      $(this).find('.showLinks').fadeIn(); 
    }, 
    function(){ 
      $(this).find('.imagio').fadeIn(); 
      $(this).find('.showLinks').fadeOut(); 
    } 
  );
});
使用类选择器

$('.className') 
$('div') 
或节点选择器

$('.className') 
$('div') 
或者两者都有

$('div.className')
然后在悬停处理程序中,使用

$(本)

e、 g

$(document).ready(function() {
  $('div.recentWork').hover( 
    function(){ 
      $(this).find('.imagio').fadeOut(); 
      $(this).find('.showLinks').fadeIn(); 
    }, 
    function(){ 
      $(this).find('.imagio').fadeIn(); 
      $(this).find('.showLinks').fadeOut(); 
    } 
  );
});

我一直在试着把你说的话用在实践上。。。将元素更改为类,但仍有一些后续问题。您介意将示例代码应用到我的代码中吗?我知道我想在链接中添加一个类来显示它们,但我不知道如何根据我的代码结构….$(这)引用当前选择器,在上面的代码示例中,它是$('div.recentWork')。从那里你想在recentWork块中找到div.links吗?我假设您的页面上有几个div.recentWork块?不确定哪些部分在重复。如果你发布带有多个块的html,我可以在选择器方面提供更多帮助。我只是在猜测,因为我不知道你的php将如何呈现$('div.recentWork').hover(function(){$(this).find('.imagio').fadeOut();$(this).find('.showLinks').fadeIn();},function(){$(this).find('.imagio').fadeIn();$(this).find('.showLinks').fadeOut();});我一直在试着把你说的话用在实践上。。。将元素更改为类,但仍有一些后续问题。您介意将示例代码应用到我的代码中吗?我知道我想在链接中添加一个类来显示它们,但我不知道如何根据我的代码结构….$(这)引用当前选择器,在上面的代码示例中,它是$('div.recentWork')。从那里你想在recentWork块中找到div.links吗?我假设您的页面上有几个div.recentWork块?不确定哪些部分在重复。如果你发布带有多个块的html,我可以在选择器方面提供更多帮助。我只是在猜测,因为我不知道你的php将如何呈现$('div.recentWork').hover(function(){$(this).find('.imagio').fadeOut();$(this).find('.showLinks').fadeIn();},function(){$(this).find('.imagio').fadeIn();$(this).find('.showLinks').fadeOut();});