小编lok*_*ers的帖子

用其他链接调用fancybox gallery

我有很独特的情况.这是我的场景:4个缩略图链接到图库+ 1个中等图像(指向与第一个缩略图相同的源).我想通过单击中间图像来打开相同的图库,但是当我用"rel"属性链接它们时,我在循环中有第一张图片两次(循环中有5个大图像).有没有办法在外部链接中调用指定的fancybox图库?这样我可以触发媒体图像上的点击功能,并且在循环中仍然只有4个大图像.请帮忙,我找不到解决方案.

UPDATE

这是我的HTML

<div class="details_gallery">
 <a href="max/1.jpg" class="fancybox"><img src="mid/1.jpg" /></a>
 <div class="details_gallery_min">
  <a rel="details" href="max/1.jpg" class="fancybox"><img src="min/1.jpg" alt="" /></a>
  <a rel="details" href="max/2.jpg" class="fancybox"><img src="min/2.jpg" alt="" /></a>
  <a rel="details" href="max/3.jpg" class="fancybox"><img src="min/3.jpg" alt="" /></a>
  <a rel="details" href="max/4.jpg" class="fancybox"><img src="min/4.jpg" alt="" /></a>
 </div>
</div> 
Run Code Online (Sandbox Code Playgroud)

我想在点击"mid"图像时触发"细节"库......

jquery gallery fancybox

5
推荐指数
2
解决办法
1万
查看次数

如何使用AngularJS观察localstorage更改

是否可以使用$ watch来监控对localStorage的更改?

我有一个工厂让设置/变得更简单

.factory('$localstorage', ['$window', function($window) {
    return {
        set: function(key, value) {
            $window.localStorage[key] = value;
        },

        get: function(key, defaultValue) {
            return $window.localStorage[key] || defaultValue;
        },

        setObject: function(key, value) {
            $window.localStorage[key] = JSON.stringify(value);
        },

        getObject: function(key) {
            return JSON.parse($window.localStorage[key] || '{}');
        }
    }
}]);
Run Code Online (Sandbox Code Playgroud)

在我的控制器中我有

.controller('CodesCtrl', function($scope, $localstorage) {
    $scope.codes = $localstorage.getObject('codes');
    ...
Run Code Online (Sandbox Code Playgroud)

在另一个控制器中,我正在添加到本地存储.我想在localStorage更改后立即呈现更改.

我已经看过一些SO帖子使用像ngStorage这样的东西,但理想情况下我想避免这样做.

可能吗?有人能指出我正确的方向吗?

javascript angularjs

5
推荐指数
1
解决办法
9671
查看次数

我无法在mac os x上安装composer

按照这个页面的说明(下面的链接),我仍然无法安装作曲家,我不知道我在这里失败了.有没有好眼睛发现我的错误?我很亲密,我能感觉到它但没有运气,这可能是我在这里做的一个简单的错误...请帮忙!

https://getcomposer.org/download/

步骤1:

curl -sS https://getcomposer.org/installer | php
Run Code Online (Sandbox Code Playgroud)

控制台响应:

#!/usr/bin/env php
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl
Run Code Online (Sandbox Code Playgroud)

第2步:

<?php phpinfo(); ?>
Run Code Online (Sandbox Code Playgroud)

响应:

Apache Version
Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.1e DAV/2 PHP/5.4.15

Additional .ini files parsed
/opt/local/var/db/php54/openssl.ini,

OpenSSL support …
Run Code Online (Sandbox Code Playgroud)

php macos macports composer-php php-openssl

1
推荐指数
1
解决办法
6220
查看次数