Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling in IE(any version) #225

Closed
yairneumann11 opened this issue Apr 25, 2012 · 1 comment
Closed

Compiling in IE(any version) #225

yairneumann11 opened this issue Apr 25, 2012 · 1 comment

Comments

@yairneumann11
Copy link

I'm pretty sure I am to blame but for the life of me I cant figure why it's working on every browser except IE.
I followed a tutorial by NetTuts, did everything like they said and still won't compile. Any help would be great..

HTML:

....

                        <script id="flickr-template" type="text/x-handlebars-template">
                        
                            {{#each this}}
                                <li id="hover">
                                    <a rel="fancybox" href="{{urlBig}}"><img src="{{urlSmall}}" alt"{{title}}"/></a>
                                </li>
                            {{/each}}
                            
                                <script type="text/javascript">
                                
                                    $(document).ready(function() {
                                        
                                        var imageOpacity = $('#flickrArt li img').css("opacity");
                                        console.log(imageOpacity);
                                        $("a[rel=fancybox]").fancybox();
                                        
                                        $('#flickrArt li img').hover(function() { 
                                             $(this).stop().animate({"opacity": 1});
                                             console.log(imageOpacity);
                                        },function() { 
                                             $(this).stop().animate({"opacity": imageOpacity}); 
                                            });
                                        
                                        }); 
                                        
                                </script>
                                                                
                        </script>
                        
                    </div>

Js:

(function () {

var Flickr = {
    init: function( config ) {
        this.photoSet = config.photoSet;

        this.url = "http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=f60532ff654d15302a9f5f7ea8c61d9b&photoset_id="+config.photoSet+"&format=json&nojsoncallback=1";
        console.log(this.url);
        this.template = config.template;
        this.container = config.container;
        this.fetch();
        },

        attachTemplate: function(){

            var template = Handlebars.compile( this.template );

            this.container.append( template( this.photos ) ); 
        },


        fetch: function() {

            var self = this;

            $.getJSON( this.url, function( data ){

                    self.photos = $.map( data.photoset.photo, function( photo ){

                        return{
                            id: photo.id,
                            secret: photo.secret,
                            server: photo.farm,
                            farm: photo.server,
                            title: photo.title,
                            urlSmall: "http://farm"+ photo.farm +".staticflickr.com/" + photo.server + "/"+ photo.id +"_"+ photo.secret +"_s.jpg",
                            urlBig: "http://farm"+ photo.farm +".staticflickr.com/" + photo.server + "/"+ photo.id +"_"+ photo.secret +"_z.jpg",

                        }
                    })


                    self.attachTemplate();

            })



        }       

    };

     Flickr.init({
        template: $("#flickr-template").html(),
        container: $("#flickrArt"),
        photoSet:"72157624829823835",

    });



})();
@wagenet
Copy link
Collaborator

wagenet commented May 4, 2012

It's not really clear what you're trying to do here. However, you might want to look at what Ember does to get Handlebars from the DOM: https://github.com/emberjs/ember.js/blob/master/packages/ember-handlebars/lib/loader.js

If you still have problems, you might want to consider asking on Stack Overflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants