Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김동훈
/
OpenSource_Project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
전수민
2018-12-14 05:42:03 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c8e9c4b3794760b2f5698dfff091b932128cb91b
c8e9c4b3
1 parent
9f0dcc29
Show Food List
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
public/Foods.html
public/js/showFood.js
public/Foods.html
View file @
c8e9c4b
...
...
@@ -86,7 +86,7 @@
<!-- Icon Cards-->
<div
class=
"row"
id=
"body"
>
<
!--<
script>
<script>
var
queryString
=
decodeURIComponent
(
window
.
location
.
search
);
queryString
=
queryString
.
substring
(
1
);
...
...
@@ -96,7 +96,7 @@
document
.
write
(
queries
[
i
]
+
"<br>"
);
}
</script>
-->
</script>
<script
src=
"js/showFood.js"
></script>
</div>
...
...
public/js/showFood.js
View file @
c8e9c4b
...
...
@@ -3,25 +3,27 @@
var
entName
=
''
;
var
entType
=
''
;
var
entPhoto
=
''
;
var
card
=
'<div class="col-xl-6 col-sm-6 mb-3">'
+
'<div class="card text-white bg-light o-hidden h-100">'
+
'<div class="card-body"'
+
' style="height:300px; background-size: 100% 100%; background-repeat: no-repeat; background-image:url('
+
"'"
+
entPhoto
+
"');"
+
'">'
+
// place photo
'<div class="mr-5" id="nameDiv">'
+
entName
+
'</div>'
+
// place name
'<div class="mr-5" id="typeDiv">'
+
entType
+
'</div>'
+
// place type
'</div>'
+
'</div>'
+
'</div>'
;
var
card
=
''
;
for
(
var
i
=
0
;
i
<
entList
.
size
();
i
++
){
entName
=
entList
[
i
][
name
];
entType
=
entList
[
i
][
type
];
if
(
entList
[
i
][
photo
]
==
null
){
if
(
entList
[
i
][
photo
]
==
undefined
){
entPhoto
=
"noimage.png"
;
}
else
{
entPhoto
=
entList
[
i
][
photo
];
}
card
+=
card
;
var
tmp
=
'<div class="col-xl-6 col-sm-6 mb-3">'
+
'<div class="card text-white bg-light o-hidden h-100">'
+
'<div class="card-body"'
+
' style="height:300px; background-size: 100% 100%; background-repeat: no-repeat; background-image:url('
+
"'"
+
entPhoto
+
"');"
+
'">'
+
// place photo
'<div class="mr-5" id="nameDiv">'
+
entName
+
'</div>'
+
// place name
'<div class="mr-5" id="typeDiv">'
+
entType
+
'</div>'
+
// place type
'</div>'
+
'</div>'
+
'</div>'
;
card
+=
tmp
;
}
document
.
getElementById
(
"body"
).
innerHTML
=
card
;
\ No newline at end of file
...
...
Please
register
or
login
to post a comment