简体   繁体   English

尝试更改jQuery的上一个和下一个按钮

[英]Trying to change a jquery Prev and Next Button

I am trying to modify a time table which I am getting from an api call. 我正在尝试修改从api调用中获取的时间表。 I am able to modify everything in css except for the prev and next button. 我可以修改CSS中的所有内容,除了prev和next按钮。 I do not know Jquery that is why I am struggling to understand. 我不知道Jquery,这就是我努力理解的原因。 It will be helpful if someone can give me some direction or example - 如果有人可以给我一些指导或示例,这将很有帮助-

Currently I have modified it to look like this although I am unable to modify the button because I am not sure where this generating and how to put a new icon between those two button div as well - 目前,尽管我无法修改按钮,但由于无法确定生成位置以及如何在这两个按钮div之间放置新图标,因此我将其修改为如下所示:

在此处输入图片说明

I am trying to achieve this - 我正在努力实现这一目标-

在此处输入图片说明

The following js are used to call the api and making it a weekly view for next 12 weeks. 以下js用于调用api,并使其在接下来的12周内每周查看一次。 - --

drupal_add_js(
'https://api3.libcal.com/js/hours_grid.js?002',
array(
  'type' => 'external',
  'scope' => 'footer',
)
);
drupal_add_js(
'(function($) { 
  var week0 = new $.LibCalWeeklyGrid( $("#s-lc-whw0"), { iid: 1131, lid: 0,  weeks: 12 }); 
  })(jQuery);',
array(
  'type' => 'inline',
  'scope' => 'footer',
)
);

Please let me know If any other info needed. 请让我知道是否需要其他信息。

It looks like you should be able to style the arrows with the CSS classnames on the buttons: 看起来您应该能够在按钮上使用CSS类名来设置箭头样式:

.s-lc-vhw-pr {
  /* styles for previous button */
}

.s-lc-vhw-ne {
  /* styles for next button */
}

As far as putting the icon in between the two buttons, you could try using a CSS pseudo element ::after after the first button to get it to show up there if it's only a visual element. 至于将图标放在两个按钮之间,您可以尝试在第一个按钮::after使用CSS伪元素::after ,如果它只是视觉元素,则可以将其显示在此处。

.s-lc-vhw-pr::after {
  /* can create a placeholder element which would have the calendar icon as a background image */

}

Here's a rough example: https://jsfiddle.net/g9r5g8x0/ 这是一个粗略的示例: https : //jsfiddle.net/g9r5g8x0/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM