@@ -50,42 +50,38 @@ <h1>My Library – List of books</h1>
50
50
</ table >
51
51
52
52
< div id ="rightSide " >
53
-
54
53
< h2 id ="bookTitle "> Title</ h2 >
55
54
< h3 id ="bookAuthor "> Author</ h3 >
56
55
< p id ="bookDescription "> Description</ p >
56
+ < img src ="https://upload.wikimedia.org/wikipedia/en/a/a0/Harry_Potter_and_the_Prisoner_of_Azkaban.jpg " alt ="book image " width ="70% " height ="70% ">
57
57
</ div >
58
58
59
59
< script th:inline ="javascript ">
60
60
61
61
var isResized = false ;
62
62
var lastId ;
63
63
function showDetail ( id , title , page , year , author ) {
64
-
65
- if ( isResized && lastId === id ) {
64
+ if ( lastId ) {
65
+ document . getElementById ( lastId ) . style . backgroundColor = "#FFFFFF" ;
66
+ }
67
+ if ( isResized && lastId === id ) {
66
68
document . getElementById ( 'booksTable' ) . style . width = "100%" ;
67
69
document . getElementById ( 'rightSide' ) . style . display = "none" ;
68
70
} else {
69
- document . getElementById ( 'booksTable' ) . style . width = "50%" ;
71
+ document . getElementById ( id ) . style . backgroundColor = "#1979a9" ;
72
+ document . getElementById ( 'booksTable' ) . style . width = "60%" ;
70
73
document . getElementById ( 'booksTable' ) . style . float = "left" ;
71
-
72
74
document . getElementById ( 'rightSide' ) . style . float = "left" ;
73
- document . getElementById ( 'rightSide' ) . style . width = "40 %" ;
75
+ document . getElementById ( 'rightSide' ) . style . width = "35 %" ;
74
76
document . getElementById ( 'rightSide' ) . style . display = "block" ;
75
- document . getElementById ( 'rightSide' ) . style . margin = "1% 5% 1% 5%" ;
76
-
77
+ document . getElementById ( 'rightSide' ) . style . margin = "1% 2.5% 1% 2.5%" ;
77
78
document . getElementById ( 'bookTitle' ) . innerHTML = title ;
78
79
document . getElementById ( 'bookAuthor' ) . innerHTML = author ;
79
80
document . getElementById ( 'bookDescription' ) . innerHTML = 'Year: ' + year + ', pages: ' + page ;
80
81
}
81
-
82
-
83
-
84
82
isResized = ! isResized ;
85
83
lastId = id ;
86
84
}
87
-
88
-
89
85
</ script >
90
86
</ body >
91
87
</ html >
0 commit comments