0

好的,我一直在尝试获取 fancybox 内联弹出窗口的源代码,但我似乎无法获得它。我将代码完美地组合在一起,但是当我尝试将其保存到我的site builder.

Fancybox:http ://fancyapps.com/fancybox/#examples (我试图在网页底部附近获得“内联 - 自动检测宽度/高度”)

这是我尝试过的:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="/js/fancybox-1.3.4/jquery.fancybox-1.3.4.js">   </script>
<link rel="stylesheet" type="text/css" href="/js/fancybox-1.3.4/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<style>
 @media only screen and (max-width: 900px) {
  /* change the media content paddings and margins
  if the screen's max-width is just 900px
  if total width is 900px only..*/
  }
 </style>
</head>
<body>

<ul>
  <li>
   <a id="various1" href="#inline1" title="Lorem ipsum dolor sit amet">Inline - auto detect width / height
   </a>
  </li>
</ul>
</body>
</html>
4

1 回答 1

1

他们正在使用什么,可以通过

  1. 使用媒体查询的 CSS

  2. jQuery,但使用的是最新版本。你用的是旧的!在这里获取最新的:http ://www.jquery.com在他们的页脚中!

使用 CSS:

你可以使用 CSS,是这样的:

@media only screen and (max-width: 900px) {
 /* change the media content paddings and margins
 if the screen's max-width is just 900px
 if total width is 900px only..*/
}

max-width: 900px然后,当您想要更改页脚和其他元素的填充或宽度或其他 css 属性时,您可以将其更改为任何其他屏幕尺寸。

如果你想使用 jQuery:

然后你可以使用:

if ($(window).width() < 960) {
  $('footer').css('padding', '20px');
}

如果 window.width 小于 960,此代码会将页脚标签的内边距更改为 20px!

这就是他们正在使用的。其次, 的实时移动可能footer是因为百分比填充。因为它会自动移动;那么猜测将是百分比填充。

于 2013-10-04T01:03:17.667 回答