Browse Source

Update theme.js

tested
Sorunome 8 years ago
parent
commit
bfe821953e
1 changed files with 8 additions and 1 deletions
  1. 8 1
      scripts/theme.js

+ 8 - 1
scripts/theme.js

@@ -91,7 +91,7 @@ if (is_ie7down && 'attachEvent' in window){
 
 // automatic responsive image resizing
 $(function(){
-	if($('.poster').length > 0){
+	if($('.poster').length > 0){ // inside of a normal topic
 		var $sheet = $('<style>').appendTo('head');
 		$(window).resize(function(){
 			// 90% - 88px - 15em(of .poster)
@@ -99,4 +99,11 @@ $(function(){
 			$sheet.html('img.bbc_img{max-width:'+w+'px;}');
 		}).resize();
 	}
+	if($('.dp_news').length > 0){ // front page news
+		$sheet = $('<style>').appendTo('head');
+		$(window).resize(function(){
+			var w = parseFloat($(window).width())*0.9 - 500;
+			$sheet.html('img.bbc_img{max-width:'+w+'px;}');
+		}).resize();
+	}
 });