【问题标题】:send value from anchor to popup将值从锚点发送到弹出窗口
【发布时间】:2018-10-09 19:33:46
【问题描述】:

我正在使用这种方式显示一个弹出div

<a href="<?php echo is_user_logged_in() ? '#ask-question-div' : '#login' ?>" class="open-question-popup"></a>

当点击类'open-question-popup'的锚点时,几个锚点共享同一个弹出窗口,所以它们都有相同的锚点代码,问题是我想将每个父div的标题发送到单击相应的锚元素时,弹出窗口(#ask-question-div)将显示为标题。

【问题讨论】:

标签: php jquery anchor


【解决方案1】:

这里没有显示相关的html是一种通用的方法

$('.open-question-popup').on('clcik', function(){
  // `this` is the `<a>` event occurred on 
  var title = $(this).closest('div').attr('title');// not clear where value should come from
  $('#ask-question-div').find(someElement).text(title);//not clear where to put it

})

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-01-16
  • 1970-01-01
  • 1970-01-01
  • 2012-06-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多