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

Bind working in browser but not is mobile devices. #59

Open
dhrubo001 opened this issue Dec 23, 2016 · 0 comments
Open

Bind working in browser but not is mobile devices. #59

dhrubo001 opened this issue Dec 23, 2016 · 0 comments

Comments

@dhrubo001
Copy link

I have a chat box where it scrolls to the bottom and loads all the chats,(which includes images).
It's working fine in browser, but images not loading in the mobile devices

var wrap = $("html,body #chatdiv");
wrap.on("load scroll", function(e) {
$('.chats_attachments').bind('inview', function (event, visible) {
var status = $(this).attr("data-loaded");

			if(status == 0)
			{
				var src = $(this).attr("data-src");
				$(this).attr("src",base_url+"/assets/img/chats/"+src);
				
				$(this).load(function() {
				  $(this).attr("data-loaded",1);
				});
			}
	 });
});

Why this is happening, Check the screenshots
desktop
This is the mobile view... I have a fake image which willl be converted to the actual image using data-src attribute

mobile

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

1 participant