基于收到的的有用答案,我创建了以下脚本,命名为convert_image_paths.command,将它放在mac上的一个网站文件夹中,然后双击它。
#!/bin/bash
# This script will operate on valid relative image paths at this level and one sub-level down, across .html and .css files.
find . -name "*.css" -o -name "*.html" -exec sed -i '' 's/
向下滚动600px后,我希望css背景图像从没有图像显示为确定的背景图像(图1);然而,在600px以上,我想更改为另一个图像(图2)。我希望此操作重复执行,而不必刷新页面。
下面是我的代码:
jQuery:
$(window).scroll(function() {
var y_scroll_pos = window.pageYOffset;
var scroll_pos_test = 800;
// set to whatever you want it to be
if(y_scroll_pos > scroll_pos_